[Update][PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-13 Thread Huang, Ying
This patch is to reduce the lock contention of swap_info_struct->lock via using a more fine grained lock in swap_cluster_info for some swap operations. swap_info_struct->lock is heavily contended if multiple processes reclaim pages simultaneously. Because there is only one lock for each swap

[Update][PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-13 Thread Huang, Ying
This patch is to reduce the lock contention of swap_info_struct->lock via using a more fine grained lock in swap_cluster_info for some swap operations. swap_info_struct->lock is heavily contended if multiple processes reclaim pages simultaneously. Because there is only one lock for each swap

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Huang, Ying
Andrew Morton writes: > On Thu, 12 Jan 2017 09:47:51 +0800 "Huang\, Ying" > wrote: > >> >> > 1MB swap space, so for 1TB swap space, the total size will be 80M >> >> > compared with 8M of current implementation. >> > >> > Where did this 80 bytes

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Huang, Ying
Andrew Morton writes: > On Thu, 12 Jan 2017 09:47:51 +0800 "Huang\, Ying" > wrote: > >> >> > 1MB swap space, so for 1TB swap space, the total size will be 80M >> >> > compared with 8M of current implementation. >> > >> > Where did this 80 bytes come from? That swap_cluster_info is 12 bytes >>

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Andrew Morton
On Thu, 12 Jan 2017 09:47:51 +0800 "Huang\, Ying" wrote: > >> > 1MB swap space, so for 1TB swap space, the total size will be 80M > >> > compared with 8M of current implementation. > > > > Where did this 80 bytes come from? That swap_cluster_info is 12 bytes > > and could

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Andrew Morton
On Thu, 12 Jan 2017 09:47:51 +0800 "Huang\, Ying" wrote: > >> > 1MB swap space, so for 1TB swap space, the total size will be 80M > >> > compared with 8M of current implementation. > > > > Where did this 80 bytes come from? That swap_cluster_info is 12 bytes > > and could perhaps be squeezed

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Huang, Ying
Hi, Andrew, Andrew Morton writes: > On Wed, 11 Jan 2017 16:07:29 -0700 Jonathan Corbet wrote: > >> On Wed, 11 Jan 2017 15:00:29 -0800 >> Andrew Morton wrote: >> >> > hm, bit_spin_lock() is a nasty thing. It is slow and it

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Huang, Ying
Hi, Andrew, Andrew Morton writes: > On Wed, 11 Jan 2017 16:07:29 -0700 Jonathan Corbet wrote: > >> On Wed, 11 Jan 2017 15:00:29 -0800 >> Andrew Morton wrote: >> >> > hm, bit_spin_lock() is a nasty thing. It is slow and it doesn't have >> > all the lockdep support. >> > >> > Would the world

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Huang, Ying
Hi, Jonathan, Jonathan Corbet writes: > On Wed, 11 Jan 2017 15:00:29 -0800 > Andrew Morton wrote: > >> hm, bit_spin_lock() is a nasty thing. It is slow and it doesn't have >> all the lockdep support. >> >> Would the world end if we added a spinlock

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Huang, Ying
Hi, Jonathan, Jonathan Corbet writes: > On Wed, 11 Jan 2017 15:00:29 -0800 > Andrew Morton wrote: > >> hm, bit_spin_lock() is a nasty thing. It is slow and it doesn't have >> all the lockdep support. >> >> Would the world end if we added a spinlock to swap_cluster_info? > > FWIW, I asked the

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Andrew Morton
On Wed, 11 Jan 2017 16:07:29 -0700 Jonathan Corbet wrote: > On Wed, 11 Jan 2017 15:00:29 -0800 > Andrew Morton wrote: > > > hm, bit_spin_lock() is a nasty thing. It is slow and it doesn't have > > all the lockdep support. > > > > Would the world end

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Andrew Morton
On Wed, 11 Jan 2017 16:07:29 -0700 Jonathan Corbet wrote: > On Wed, 11 Jan 2017 15:00:29 -0800 > Andrew Morton wrote: > > > hm, bit_spin_lock() is a nasty thing. It is slow and it doesn't have > > all the lockdep support. > > > > Would the world end if we added a spinlock to

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Jonathan Corbet
On Wed, 11 Jan 2017 15:00:29 -0800 Andrew Morton wrote: > hm, bit_spin_lock() is a nasty thing. It is slow and it doesn't have > all the lockdep support. > > Would the world end if we added a spinlock to swap_cluster_info? FWIW, I asked the same question in

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Jonathan Corbet
On Wed, 11 Jan 2017 15:00:29 -0800 Andrew Morton wrote: > hm, bit_spin_lock() is a nasty thing. It is slow and it doesn't have > all the lockdep support. > > Would the world end if we added a spinlock to swap_cluster_info? FWIW, I asked the same question in December, this is what I got: jon

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Andrew Morton
On Wed, 11 Jan 2017 09:55:12 -0800 Tim Chen wrote: > From: "Huang, Ying" > > This patch is to reduce the lock contention of swap_info_struct->lock > via using a more fine grained lock in swap_cluster_info for some swap > operations.

Re: [PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Andrew Morton
On Wed, 11 Jan 2017 09:55:12 -0800 Tim Chen wrote: > From: "Huang, Ying" > > This patch is to reduce the lock contention of swap_info_struct->lock > via using a more fine grained lock in swap_cluster_info for some swap > operations. swap_info_struct->lock is heavily contended if multiple >

[PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Tim Chen
From: "Huang, Ying" This patch is to reduce the lock contention of swap_info_struct->lock via using a more fine grained lock in swap_cluster_info for some swap operations. swap_info_struct->lock is heavily contended if multiple processes reclaim pages simultaneously.

[PATCH v5 2/9] mm/swap: Add cluster lock

2017-01-11 Thread Tim Chen
From: "Huang, Ying" This patch is to reduce the lock contention of swap_info_struct->lock via using a more fine grained lock in swap_cluster_info for some swap operations. swap_info_struct->lock is heavily contended if multiple processes reclaim pages simultaneously. Because there is only one