Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-13 Thread Huang, Ying
Minchan Kim writes: > Hi Huang, > > Sorry for the late response. I'm in middle of long vacation. > > On Fri, Dec 08, 2017 at 08:32:16PM +0800, Huang, Ying wrote: >> Minchan Kim writes: >> >> > On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-13 Thread Huang, Ying
Minchan Kim writes: > Hi Huang, > > Sorry for the late response. I'm in middle of long vacation. > > On Fri, Dec 08, 2017 at 08:32:16PM +0800, Huang, Ying wrote: >> Minchan Kim writes: >> >> > On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying wrote: >> >> Minchan Kim writes: >> >> >>

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Minchan Kim
Hi Huang, Sorry for the late response. I'm in middle of long vacation. On Fri, Dec 08, 2017 at 08:32:16PM +0800, Huang, Ying wrote: > Minchan Kim writes: > > > On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying wrote: > >> Minchan Kim writes: > >>

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Minchan Kim
Hi Huang, Sorry for the late response. I'm in middle of long vacation. On Fri, Dec 08, 2017 at 08:32:16PM +0800, Huang, Ying wrote: > Minchan Kim writes: > > > On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying wrote: > >> Minchan Kim writes: > >> > >> > On Fri, Dec 08, 2017 at

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Paul E. McKenney
On Wed, Dec 13, 2017 at 10:17:41AM +0800, Huang, Ying wrote: > "Paul E. McKenney" writes: > > > On Tue, Dec 12, 2017 at 09:12:20AM +0800, Huang, Ying wrote: > >> Hi, Pual, > >> > >> "Paul E. McKenney" writes: > >> > >> > On Mon, Dec 11,

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Paul E. McKenney
On Wed, Dec 13, 2017 at 10:17:41AM +0800, Huang, Ying wrote: > "Paul E. McKenney" writes: > > > On Tue, Dec 12, 2017 at 09:12:20AM +0800, Huang, Ying wrote: > >> Hi, Pual, > >> > >> "Paul E. McKenney" writes: > >> > >> > On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: > >> >>

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Huang, Ying
"Paul E. McKenney" writes: > On Tue, Dec 12, 2017 at 09:12:20AM +0800, Huang, Ying wrote: >> Hi, Pual, >> >> "Paul E. McKenney" writes: >> >> > On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: >> >> Andrew Morton

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Huang, Ying
"Paul E. McKenney" writes: > On Tue, Dec 12, 2017 at 09:12:20AM +0800, Huang, Ying wrote: >> Hi, Pual, >> >> "Paul E. McKenney" writes: >> >> > On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: >> >> Andrew Morton writes: >> >> >> >> > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\,

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Paul E. McKenney
On Tue, Dec 12, 2017 at 09:12:20AM +0800, Huang, Ying wrote: > Hi, Pual, > > "Paul E. McKenney" writes: > > > On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: > >> Andrew Morton writes: > >> > >> > On Fri, 08 Dec 2017 16:41:38

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-12 Thread Paul E. McKenney
On Tue, Dec 12, 2017 at 09:12:20AM +0800, Huang, Ying wrote: > Hi, Pual, > > "Paul E. McKenney" writes: > > > On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: > >> Andrew Morton writes: > >> > >> > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" > >> > wrote: > >> > > >> >> >

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-11 Thread Huang, Ying
Hi, Pual, "Paul E. McKenney" writes: > On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: >> Andrew Morton writes: >> >> > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" >> > wrote: >> > >> >> > Why do

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-11 Thread Huang, Ying
Hi, Pual, "Paul E. McKenney" writes: > On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: >> Andrew Morton writes: >> >> > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" >> > wrote: >> > >> >> > Why do we need srcu here? Is it enough with rcu like below? >> >> > >> >> > It

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-11 Thread Paul E. McKenney
On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: > Andrew Morton writes: > > > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" > > wrote: > > > >> > Why do we need srcu here? Is it enough with rcu like below? > >> > > >> > It might

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-11 Thread Paul E. McKenney
On Mon, Dec 11, 2017 at 01:30:03PM +0800, Huang, Ying wrote: > Andrew Morton writes: > > > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" > > wrote: > > > >> > Why do we need srcu here? Is it enough with rcu like below? > >> > > >> > It might have a bug/room to be optimized about

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-10 Thread Huang, Ying
Andrew Morton writes: > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" > wrote: > >> > Why do we need srcu here? Is it enough with rcu like below? >> > >> > It might have a bug/room to be optimized about performance/naming. >> > I just wanted

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-10 Thread Huang, Ying
Andrew Morton writes: > On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" > wrote: > >> > Why do we need srcu here? Is it enough with rcu like below? >> > >> > It might have a bug/room to be optimized about performance/naming. >> > I just wanted to show my intention. >> >> Yes. rcu should

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Andrew Morton
On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" wrote: > > Why do we need srcu here? Is it enough with rcu like below? > > > > It might have a bug/room to be optimized about performance/naming. > > I just wanted to show my intention. > > Yes. rcu should work too. But

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Andrew Morton
On Fri, 08 Dec 2017 16:41:38 +0800 "Huang\, Ying" wrote: > > Why do we need srcu here? Is it enough with rcu like below? > > > > It might have a bug/room to be optimized about performance/naming. > > I just wanted to show my intention. > > Yes. rcu should work too. But if we use rcu, it may

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Huang, Ying
Minchan Kim writes: > On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying wrote: >> Minchan Kim writes: >> >> > On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: >> >> Minchan Kim writes: >> >> >> >> > On Thu, Dec 07,

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Huang, Ying
Minchan Kim writes: > On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying wrote: >> Minchan Kim writes: >> >> > On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: >> >> Minchan Kim writes: >> >> >> >> > On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: >> >> >> On

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Minchan Kim
On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying wrote: > Minchan Kim writes: > > > On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: > >> Minchan Kim writes: > >> > >> > On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: > >>

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Minchan Kim
On Fri, Dec 08, 2017 at 04:41:38PM +0800, Huang, Ying wrote: > Minchan Kim writes: > > > On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: > >> Minchan Kim writes: > >> > >> > On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: > >> >> On Thu, 7 Dec 2017 09:14:26 +0800

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Huang, Ying
Minchan Kim writes: > On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: >> Minchan Kim writes: >> >> > On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: >> >> On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying"

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Huang, Ying
Minchan Kim writes: > On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: >> Minchan Kim writes: >> >> > On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: >> >> On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying" >> >> wrote: >> >> >> >> > When the swapin is performed,

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Minchan Kim
On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: > Minchan Kim writes: > > > On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: > >> On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying" > >> wrote: > >> > >> > When the swapin is

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-08 Thread Minchan Kim
On Fri, Dec 08, 2017 at 01:41:10PM +0800, Huang, Ying wrote: > Minchan Kim writes: > > > On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: > >> On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying" > >> wrote: > >> > >> > When the swapin is performed, after getting the swap entry

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-07 Thread Minchan Kim
On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: > On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying" wrote: > > > When the swapin is performed, after getting the swap entry information > > from the page table, the PTL (page table lock) will be released, then >

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-07 Thread Minchan Kim
On Thu, Dec 07, 2017 at 04:29:37PM -0800, Andrew Morton wrote: > On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying" wrote: > > > When the swapin is performed, after getting the swap entry information > > from the page table, the PTL (page table lock) will be released, then > > system will go to

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-07 Thread Andrew Morton
On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying" wrote: > When the swapin is performed, after getting the swap entry information > from the page table, the PTL (page table lock) will be released, then > system will go to swap in the swap entry, without any lock held to >

Re: [PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-07 Thread Andrew Morton
On Thu, 7 Dec 2017 09:14:26 +0800 "Huang, Ying" wrote: > When the swapin is performed, after getting the swap entry information > from the page table, the PTL (page table lock) will be released, then > system will go to swap in the swap entry, without any lock held to > prevent the swap device

[PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-06 Thread Huang, Ying
From: Huang Ying When the swapin is performed, after getting the swap entry information from the page table, the PTL (page table lock) will be released, then system will go to swap in the swap entry, without any lock held to prevent the swap device from being swapoff. This

[PATCH -mm] mm, swap: Fix race between swapoff and some swap operations

2017-12-06 Thread Huang, Ying
From: Huang Ying When the swapin is performed, after getting the swap entry information from the page table, the PTL (page table lock) will be released, then system will go to swap in the swap entry, without any lock held to prevent the swap device from being swapoff. This may cause the race