Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread David Chinner
On Fri, Feb 02, 2007 at 01:24:40PM -0600, Matt Mackall wrote: > On Fri, Feb 02, 2007 at 12:05:11PM +, Christoph Hellwig wrote: > > On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: > > > > Yup. Even better, use clear_highpage(). > > > > > > For even more goodness,

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread David Chinner
On Fri, Feb 02, 2007 at 12:05:11PM +, Christoph Hellwig wrote: > On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: > > > Yup. Even better, use clear_highpage(). > > > > For even more goodness, clearmem_highpage_flush() does exactly > > the right thing for partial page zeroing ;)

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread Matt Mackall
On Fri, Feb 02, 2007 at 12:05:11PM +, Christoph Hellwig wrote: > On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: > > > Yup. Even better, use clear_highpage(). > > > > For even more goodness, clearmem_highpage_flush() does exactly > > the right thing for partial page zeroing ;)

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread Christoph Hellwig
On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: > > Yup. Even better, use clear_highpage(). > > For even more goodness, clearmem_highpage_flush() does exactly > the right thing for partial page zeroing ;) Note that there are tons of places in buffer.c that could use

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread Christoph Hellwig
On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: Yup. Even better, use clear_highpage(). For even more goodness, clearmem_highpage_flush() does exactly the right thing for partial page zeroing ;) Note that there are tons of places in buffer.c that could use

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread Matt Mackall
On Fri, Feb 02, 2007 at 12:05:11PM +, Christoph Hellwig wrote: On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: Yup. Even better, use clear_highpage(). For even more goodness, clearmem_highpage_flush() does exactly the right thing for partial page zeroing ;) Note

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread David Chinner
On Fri, Feb 02, 2007 at 12:05:11PM +, Christoph Hellwig wrote: On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: Yup. Even better, use clear_highpage(). For even more goodness, clearmem_highpage_flush() does exactly the right thing for partial page zeroing ;) Note

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-02-02 Thread David Chinner
On Fri, Feb 02, 2007 at 01:24:40PM -0600, Matt Mackall wrote: On Fri, Feb 02, 2007 at 12:05:11PM +, Christoph Hellwig wrote: On Wed, Jan 31, 2007 at 02:22:24PM +1100, David Chinner wrote: Yup. Even better, use clear_highpage(). For even more goodness, clearmem_highpage_flush()

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-30 Thread David Chinner
On Tue, Jan 30, 2007 at 05:11:32PM -0800, Andrew Morton wrote: > On Wed, 31 Jan 2007 11:44:36 +1100 > David Chinner <[EMAIL PROTECTED]> wrote: > > > On Mon, Jan 29, 2007 at 06:15:57PM -0800, Andrew Morton wrote: > > > We still don't know what is the source of kmap() activity which > > >

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-30 Thread Andrew Morton
On Wed, 31 Jan 2007 11:44:36 +1100 David Chinner <[EMAIL PROTECTED]> wrote: > On Mon, Jan 29, 2007 at 06:15:57PM -0800, Andrew Morton wrote: > > We still don't know what is the source of kmap() activity which > > necessitated this patch btw. AFAIK the busiest source is ext2 directories, > > but

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-30 Thread David Chinner
On Mon, Jan 29, 2007 at 06:15:57PM -0800, Andrew Morton wrote: > We still don't know what is the source of kmap() activity which > necessitated this patch btw. AFAIK the busiest source is ext2 directories, > but perhaps NFS under certain conditions? > > > > ->prepare_write no longer requires

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-30 Thread David Chinner
On Mon, Jan 29, 2007 at 06:15:57PM -0800, Andrew Morton wrote: We still don't know what is the source of kmap() activity which necessitated this patch btw. AFAIK the busiest source is ext2 directories, but perhaps NFS under certain conditions? looks at xfs_iozero -prepare_write no longer

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-30 Thread Andrew Morton
On Wed, 31 Jan 2007 11:44:36 +1100 David Chinner [EMAIL PROTECTED] wrote: On Mon, Jan 29, 2007 at 06:15:57PM -0800, Andrew Morton wrote: We still don't know what is the source of kmap() activity which necessitated this patch btw. AFAIK the busiest source is ext2 directories, but perhaps

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-30 Thread David Chinner
On Tue, Jan 30, 2007 at 05:11:32PM -0800, Andrew Morton wrote: On Wed, 31 Jan 2007 11:44:36 +1100 David Chinner [EMAIL PROTECTED] wrote: On Mon, Jan 29, 2007 at 06:15:57PM -0800, Andrew Morton wrote: We still don't know what is the source of kmap() activity which necessitated this

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Andrew Morton
On Mon, 29 Jan 2007 17:49:14 -0800 "Martin J. Bligh" <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > On Mon, 29 Jan 2007 17:31:20 -0800 > > "Martin J. Bligh" <[EMAIL PROTECTED]> wrote: > > > >> Peter Zijlstra wrote: > >>> On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: > >>> >

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Nick Piggin
Ingo Molnar wrote: For every 64-bit Fedora box there's more than seven 32-bit boxes. I think 32-bit is going to live with us far longer than many thought, so we might as well make it work better. Both HIGHMEM and HIGHPTE is the default on many distro kernels, which pushes the kmap

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Martin J. Bligh
Andrew Morton wrote: On Mon, 29 Jan 2007 17:31:20 -0800 "Martin J. Bligh" <[EMAIL PROTECTED]> wrote: Peter Zijlstra wrote: On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: As Christoph says, it's very much preferred that code be migrated over to kmap_atomic(). Partly because kmap()

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Andrew Morton
On Mon, 29 Jan 2007 17:31:20 -0800 "Martin J. Bligh" <[EMAIL PROTECTED]> wrote: > Peter Zijlstra wrote: > > On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: > > > >> As Christoph says, it's very much preferred that code be migrated over to > >> kmap_atomic(). Partly because kmap() is

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Martin J. Bligh
Peter Zijlstra wrote: On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: As Christoph says, it's very much preferred that code be migrated over to kmap_atomic(). Partly because kmap() is deadlockable in situations where a large number of threads are trying to take two kmaps at the same

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Ingo Molnar
* Ingo Molnar <[EMAIL PROTECTED]> wrote: > Here are the numbers that i think changes the picture: i forgot to explain them: current (estimated) total installed base of 32-bit (i686) Fedora: > http://www.fedoraproject.org/awstats/stats/updates-released-fc6-i386.total current (estimated)

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Ingo Molnar
* Hugh Dickins <[EMAIL PROTECTED]> wrote: > > For every 64-bit Fedora box there's more than seven 32-bit boxes. I > > think 32-bit is going to live with us far longer than many thought, > > so we might as well make it work better. Both HIGHMEM and HIGHPTE is > > the default on many distro

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Hugh Dickins
On Mon, 29 Jan 2007, Ingo Molnar wrote: > > For every 64-bit Fedora box there's more than seven 32-bit boxes. I > think 32-bit is going to live with us far longer than many thought, so > we might as well make it work better. Both HIGHMEM and HIGHPTE is the > default on many distro kernels,

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Ingo Molnar
* Andrew Morton <[EMAIL PROTECTED]> wrote: > > Eradicate global locks. > > > > - kmap_lock is removed by extensive use of atomic_t, a new flush > >scheme and modifying set_page_address to only allow NULL<->virt > >transitions. > I really don't recall any performance problems being

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Peter Zijlstra
On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: > As Christoph says, it's very much preferred that code be migrated over to > kmap_atomic(). Partly because kmap() is deadlockable in situations where a > large number of threads are trying to take two kmaps at the same time and > we run

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Peter Zijlstra
On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: As Christoph says, it's very much preferred that code be migrated over to kmap_atomic(). Partly because kmap() is deadlockable in situations where a large number of threads are trying to take two kmaps at the same time and we run out.

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Ingo Molnar
* Andrew Morton [EMAIL PROTECTED] wrote: Eradicate global locks. - kmap_lock is removed by extensive use of atomic_t, a new flush scheme and modifying set_page_address to only allow NULL-virt transitions. I really don't recall any performance problems being reported out of

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Hugh Dickins
On Mon, 29 Jan 2007, Ingo Molnar wrote: For every 64-bit Fedora box there's more than seven 32-bit boxes. I think 32-bit is going to live with us far longer than many thought, so we might as well make it work better. Both HIGHMEM and HIGHPTE is the default on many distro kernels, which

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Ingo Molnar
* Hugh Dickins [EMAIL PROTECTED] wrote: For every 64-bit Fedora box there's more than seven 32-bit boxes. I think 32-bit is going to live with us far longer than many thought, so we might as well make it work better. Both HIGHMEM and HIGHPTE is the default on many distro kernels,

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Ingo Molnar
* Ingo Molnar [EMAIL PROTECTED] wrote: Here are the numbers that i think changes the picture: i forgot to explain them: current (estimated) total installed base of 32-bit (i686) Fedora: http://www.fedoraproject.org/awstats/stats/updates-released-fc6-i386.total current (estimated) total

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Martin J. Bligh
Peter Zijlstra wrote: On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: As Christoph says, it's very much preferred that code be migrated over to kmap_atomic(). Partly because kmap() is deadlockable in situations where a large number of threads are trying to take two kmaps at the same

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Andrew Morton
On Mon, 29 Jan 2007 17:31:20 -0800 Martin J. Bligh [EMAIL PROTECTED] wrote: Peter Zijlstra wrote: On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: As Christoph says, it's very much preferred that code be migrated over to kmap_atomic(). Partly because kmap() is deadlockable in

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Martin J. Bligh
Andrew Morton wrote: On Mon, 29 Jan 2007 17:31:20 -0800 Martin J. Bligh [EMAIL PROTECTED] wrote: Peter Zijlstra wrote: On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: As Christoph says, it's very much preferred that code be migrated over to kmap_atomic(). Partly because kmap() is

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Nick Piggin
Ingo Molnar wrote: For every 64-bit Fedora box there's more than seven 32-bit boxes. I think 32-bit is going to live with us far longer than many thought, so we might as well make it work better. Both HIGHMEM and HIGHPTE is the default on many distro kernels, which pushes the kmap

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-29 Thread Andrew Morton
On Mon, 29 Jan 2007 17:49:14 -0800 Martin J. Bligh [EMAIL PROTECTED] wrote: Andrew Morton wrote: On Mon, 29 Jan 2007 17:31:20 -0800 Martin J. Bligh [EMAIL PROTECTED] wrote: Peter Zijlstra wrote: On Sun, 2007-01-28 at 14:29 -0800, Andrew Morton wrote: As Christoph says, it's very

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Nick Piggin
Andrew Morton wrote: On Sun, 28 Jan 2007 15:11:34 +0100 Peter Zijlstra <[EMAIL PROTECTED]> wrote: +static inline int set_page_address(struct page *page, void *address) +{ + if (address) + return cmpxchg(>virtual, NULL, address) == NULL; + else { + /* +

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Andrew Morton
On Sun, 28 Jan 2007 15:11:34 +0100 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > Eradicate global locks. > > - kmap_lock is removed by extensive use of atomic_t, a new flush >scheme and modifying set_page_address to only allow NULL<->virt >transitions. > > A count of 0 is an exclusive

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Ingo Molnar
* Christoph Hellwig <[EMAIL PROTECTED]> wrote: > On Sun, Jan 28, 2007 at 04:48:06PM +0100, Ingo Molnar wrote: > > i'm sorry, but do you realize that files_lock is a global lock, > > triggered by /every single/ file close? > > Please check which thread you're in before you start such lengthy >

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Christoph Hellwig
On Sun, Jan 28, 2007 at 04:48:06PM +0100, Ingo Molnar wrote: > i'm sorry, but do you realize that files_lock is a global lock, > triggered by /every single/ file close? Please check which thread you're in before you start such lengthy rants. - To unsubscribe from this list: send the line

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Ingo Molnar
* Christoph Hellwig <[EMAIL PROTECTED]> wrote: > On Sun, Jan 28, 2007 at 04:17:00PM +0100, Ingo Molnar wrote: > > scalability. I did lock profiling on the -rt kernel, which exposes > > such things nicely. Half of the lock contention events during kernel > > compile were due to kmap(). (The

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Christoph Hellwig
On Sun, Jan 28, 2007 at 04:17:00PM +0100, Ingo Molnar wrote: > scalability. I did lock profiling on the -rt kernel, which exposes such > things nicely. Half of the lock contention events during kernel compile > were due to kmap(). (The system had 2 GB of RAM, so 40% lowmem, 60% > highmem.)

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Ingo Molnar
* Christoph Hellwig <[EMAIL PROTECTED]> wrote: > On Sun, Jan 28, 2007 at 03:11:34PM +0100, Peter Zijlstra wrote: > > Eradicate global locks. > > > > - kmap_lock is removed by extensive use of atomic_t, a new flush > >scheme and modifying set_page_address to only allow NULL<->virt > >

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Christoph Hellwig
On Sun, Jan 28, 2007 at 03:11:34PM +0100, Peter Zijlstra wrote: > Eradicate global locks. > > - kmap_lock is removed by extensive use of atomic_t, a new flush >scheme and modifying set_page_address to only allow NULL<->virt >transitions. What's the point for this? Extensive atomic_t

[PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Peter Zijlstra
Eradicate global locks. - kmap_lock is removed by extensive use of atomic_t, a new flush scheme and modifying set_page_address to only allow NULL<->virt transitions. A count of 0 is an exclusive state acting as an entry lock. This is done using inc_not_zero and cmpxchg. The restriction on

[PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Peter Zijlstra
Eradicate global locks. - kmap_lock is removed by extensive use of atomic_t, a new flush scheme and modifying set_page_address to only allow NULL-virt transitions. A count of 0 is an exclusive state acting as an entry lock. This is done using inc_not_zero and cmpxchg. The restriction on

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Christoph Hellwig
On Sun, Jan 28, 2007 at 03:11:34PM +0100, Peter Zijlstra wrote: Eradicate global locks. - kmap_lock is removed by extensive use of atomic_t, a new flush scheme and modifying set_page_address to only allow NULL-virt transitions. What's the point for this? Extensive atomic_t use is

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Ingo Molnar
* Christoph Hellwig [EMAIL PROTECTED] wrote: On Sun, Jan 28, 2007 at 03:11:34PM +0100, Peter Zijlstra wrote: Eradicate global locks. - kmap_lock is removed by extensive use of atomic_t, a new flush scheme and modifying set_page_address to only allow NULL-virt transitions.

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Christoph Hellwig
On Sun, Jan 28, 2007 at 04:17:00PM +0100, Ingo Molnar wrote: scalability. I did lock profiling on the -rt kernel, which exposes such things nicely. Half of the lock contention events during kernel compile were due to kmap(). (The system had 2 GB of RAM, so 40% lowmem, 60% highmem.) Numbers

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Ingo Molnar
* Christoph Hellwig [EMAIL PROTECTED] wrote: On Sun, Jan 28, 2007 at 04:17:00PM +0100, Ingo Molnar wrote: scalability. I did lock profiling on the -rt kernel, which exposes such things nicely. Half of the lock contention events during kernel compile were due to kmap(). (The system had 2

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Christoph Hellwig
On Sun, Jan 28, 2007 at 04:48:06PM +0100, Ingo Molnar wrote: i'm sorry, but do you realize that files_lock is a global lock, triggered by /every single/ file close? Please check which thread you're in before you start such lengthy rants. - To unsubscribe from this list: send the line

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Ingo Molnar
* Christoph Hellwig [EMAIL PROTECTED] wrote: On Sun, Jan 28, 2007 at 04:48:06PM +0100, Ingo Molnar wrote: i'm sorry, but do you realize that files_lock is a global lock, triggered by /every single/ file close? Please check which thread you're in before you start such lengthy rants.

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Andrew Morton
On Sun, 28 Jan 2007 15:11:34 +0100 Peter Zijlstra [EMAIL PROTECTED] wrote: Eradicate global locks. - kmap_lock is removed by extensive use of atomic_t, a new flush scheme and modifying set_page_address to only allow NULL-virt transitions. A count of 0 is an exclusive state acting

Re: [PATCH] mm: remove global locks from mm/highmem.c

2007-01-28 Thread Nick Piggin
Andrew Morton wrote: On Sun, 28 Jan 2007 15:11:34 +0100 Peter Zijlstra [EMAIL PROTECTED] wrote: +static inline int set_page_address(struct page *page, void *address) +{ + if (address) + return cmpxchg(page-virtual, NULL, address) == NULL; + else { + /*