lkml.org 
[lkml]   [2001]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] guard mm->rss with page_table_lock (241p11)
On Mon, 29 Jan 2001, Rasmus Andersen wrote:

> Please comment. Or else I will continue to sumbit it :)

The following will hang the kernel on SMP, since you're
already holding the spinlock here. Try compiling with
CONFIG_SMP and see what happens...

> diff -aur linux-2.4.1-pre11-clean/mm/vmscan.c linux/mm/vmscan.c
> --- linux-2.4.1-pre11-clean/mm/vmscan.c Sun Jan 28 20:53:13 2001
> +++ linux/mm/vmscan.c Mon Jan 29 22:09:18 2001
> @@ -72,7 +72,9 @@
> swap_duplicate(entry);
> set_pte(page_table, swp_entry_to_pte(entry));
> drop_pte:
> + spin_lock(&mm->page_table_lock);
> mm->rss--;
> + spin_unlock(&mm->page_table_lock);
> if (!page->age)
> deactivate_page(page);
> UnlockPage(page);

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com.br/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:16    [W:0.106 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site