Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-02-13 Thread Stephen C. Tweedie
Hi, On Mon, Feb 12, 2001 at 07:15:57PM -0800, george anzinger wrote: > Excuse me if I am off base here, but wouldn't an atomic operation be > better here. There are atomic inc/dec and add/sub macros for this. It > just seems that that is all that is needed here (from inspection of the > patch).

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-02-12 Thread Marcelo Tosatti
On Mon, 12 Feb 2001, george anzinger wrote: > Excuse me if I am off base here, but wouldn't an atomic operation be > better here. There are atomic inc/dec and add/sub macros for this. It > just seems that that is all that is needed here (from inspection of the > patch). Most functions which

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-02-12 Thread george anzinger
Excuse me if I am off base here, but wouldn't an atomic operation be better here. There are atomic inc/dec and add/sub macros for this. It just seems that that is all that is needed here (from inspection of the patch). George Rasmus Andersen wrote: > > On Mon, Jan 29, 2001 at 07:30:01PM -020

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-01-30 Thread David S. Miller
David Howells writes: > Would it not be better to use some sort of atomic add/subtract/clear operation > rather than a spinlock? (Which would also give you fewer atomic memory access > cycles). Please see older threads about this, it has been discussed to death already (hint: sizeof(atomic_t)

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-01-30 Thread Rasmus Andersen
On Tue, Jan 30, 2001 at 08:18:56AM +, David Howells wrote: > >... > > + spin_lock(&mm->page_table_lock); > > mm->rss++; > > + spin_unlock(&mm->page_table_lock); > >... > > Would it not be better to use some sort of atomic add/subtract/clear operation > rather than a spinlock? (Which w

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-01-30 Thread David Howells
>... > + spin_lock(&mm->page_table_lock); > mm->rss++; > + spin_unlock(&mm->page_table_lock); >... Would it not be better to use some sort of atomic add/subtract/clear operation rather than a spinlock? (Which would also give you fewer atomic memory access cycles). David - To unsubs

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-01-29 Thread Rik van Riel
On Mon, 29 Jan 2001, Rasmus Andersen wrote: > On Mon, Jan 29, 2001 at 07:30:01PM -0200, Rik van Riel wrote: > > 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 > > alread

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-01-29 Thread Rasmus Andersen
On Mon, Jan 29, 2001 at 07:30:01PM -0200, Rik van Riel wrote: > 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_S

Re: [PATCH] guard mm->rss with page_table_lock (241p11)

2001-01-29 Thread Rik van Riel
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