Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Andrey Ryabinin
On 04/03/2017 04:28 PM, Vlastimil Babka wrote: >> >> >> Seems it was broken by >> >> a8161d1ed6098506303c65b3701dedba876df42a >> Author: Vlastimil Babka >> Date: Thu Jul 28 15:49:19 2016 -0700 >> >> mm, page_alloc: restructure direct compaction handling in slowpath > > Yeah, looks like pre

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Vlastimil Babka
On 04/03/2017 02:38 PM, Andrey Ryabinin wrote: > > > On 04/03/2017 03:37 PM, Andrey Ryabinin wrote: >> >> >> On 04/03/2017 11:47 AM, Michal Hocko wrote: >>> On Fri 31-03-17 10:00:30, Shakeel Butt wrote: On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin wrote: > zswap_frontswap_store

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Michal Hocko
On Mon 03-04-17 16:14:51, Andrey Ryabinin wrote: > > > On 04/03/2017 03:45 PM, Michal Hocko wrote: > > On Mon 03-04-17 15:37:07, Andrey Ryabinin wrote: > >> > >> > >> On 04/03/2017 11:47 AM, Michal Hocko wrote: > >>> On Fri 31-03-17 10:00:30, Shakeel Butt wrote: > On Fri, Mar 31, 2017 at 8:3

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Andrey Ryabinin
On 04/03/2017 03:45 PM, Michal Hocko wrote: > On Mon 03-04-17 15:37:07, Andrey Ryabinin wrote: >> >> >> On 04/03/2017 11:47 AM, Michal Hocko wrote: >>> On Fri 31-03-17 10:00:30, Shakeel Butt wrote: On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin wrote: > zswap_frontswap_store() is

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Michal Hocko
On Mon 03-04-17 15:37:07, Andrey Ryabinin wrote: > > > On 04/03/2017 11:47 AM, Michal Hocko wrote: > > On Fri 31-03-17 10:00:30, Shakeel Butt wrote: > >> On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin > >> wrote: > >>> zswap_frontswap_store() is called during memory reclaim from > >>> __fronts

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Andrey Ryabinin
On 04/03/2017 03:37 PM, Andrey Ryabinin wrote: > > > On 04/03/2017 11:47 AM, Michal Hocko wrote: >> On Fri 31-03-17 10:00:30, Shakeel Butt wrote: >>> On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin >>> wrote: zswap_frontswap_store() is called during memory reclaim from __frontswap_s

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Andrey Ryabinin
On 04/03/2017 11:47 AM, Michal Hocko wrote: > On Fri 31-03-17 10:00:30, Shakeel Butt wrote: >> On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin >> wrote: >>> zswap_frontswap_store() is called during memory reclaim from >>> __frontswap_store() from swap_writepage() from shrink_page_list(). >>> Th

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Michal Hocko
On Mon 03-04-17 14:57:11, Andrey Ryabinin wrote: > On 04/03/2017 11:47 AM, Michal Hocko wrote: > > On Fri 31-03-17 10:00:30, Shakeel Butt wrote: [...] > >>> @@ -1017,9 +1018,7 @@ static int zswap_frontswap_store(unsigned type, > >>> pgoff_t offset, > >>> > >>> /* store */ > >>> len

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Andrey Ryabinin
On 04/03/2017 11:47 AM, Michal Hocko wrote: > On Fri 31-03-17 10:00:30, Shakeel Butt wrote: >> On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin >> wrote: >>> zswap_frontswap_store() is called during memory reclaim from >>> __frontswap_store() from swap_writepage() from shrink_page_list(). >>> This

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-04-03 Thread Michal Hocko
On Fri 31-03-17 10:00:30, Shakeel Butt wrote: > On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin > wrote: > > zswap_frontswap_store() is called during memory reclaim from > > __frontswap_store() from swap_writepage() from shrink_page_list(). > > This may happen in NOFS context, thus zswap shouldn'

Re: [PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-03-31 Thread Shakeel Butt
On Fri, Mar 31, 2017 at 8:30 AM, Andrey Ryabinin wrote: > zswap_frontswap_store() is called during memory reclaim from > __frontswap_store() from swap_writepage() from shrink_page_list(). > This may happen in NOFS context, thus zswap shouldn't use __GFP_FS, > otherwise we may renter into fs code a

[PATCH] mm/zswap: fix potential deadlock in zswap_frontswap_store()

2017-03-31 Thread Andrey Ryabinin
zswap_frontswap_store() is called during memory reclaim from __frontswap_store() from swap_writepage() from shrink_page_list(). This may happen in NOFS context, thus zswap shouldn't use __GFP_FS, otherwise we may renter into fs code and deadlock. zswap_frontswap_store() also shouldn't use __GFP_IO