Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-18 Thread Michal Hocko
On Tue 18-12-18 14:06:11, Hou Tao wrote: [...] > In my understanding (correct me if I am wrong), there are three ways through > which > reclamation will invoked fs related code and may cause dead-lock: > > (1) write-back dirty pages. Not possible for squashfs. only from kswapd context. So not re

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-17 Thread Hou Tao
Hi, On 2018/12/17 18:51, Tetsuo Handa wrote: > On 2018/12/17 18:33, Michal Hocko wrote: >> On Sun 16-12-18 19:51:57, Matthew Wilcox wrote: >> [...] >>> Ah, yes, that makes perfect sense. Thank you for the explanation. >>> >>> I wonder if the correct fix, however, is not to move the check for >>>

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-17 Thread Michal Hocko
On Mon 17-12-18 06:41:01, Matthew Wilcox wrote: > On Mon, Dec 17, 2018 at 03:10:44PM +0100, Michal Hocko wrote: > > On Mon 17-12-18 04:25:46, Matthew Wilcox wrote: > > > It's worth noticing that squashfs _is_ in fact holding a page locked in > > > squashfs_copy_cache() when it calls grab_cache_page

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-17 Thread Matthew Wilcox
On Mon, Dec 17, 2018 at 03:10:44PM +0100, Michal Hocko wrote: > On Mon 17-12-18 04:25:46, Matthew Wilcox wrote: > > It's worth noticing that squashfs _is_ in fact holding a page locked in > > squashfs_copy_cache() when it calls grab_cache_page_nowait(). I'm not > > sure if this will lead to troubl

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-17 Thread Michal Hocko
On Mon 17-12-18 04:25:46, Matthew Wilcox wrote: > On Mon, Dec 17, 2018 at 07:51:27PM +0900, Tetsuo Handa wrote: > > On 2018/12/17 18:33, Michal Hocko wrote: > > > On Sun 16-12-18 19:51:57, Matthew Wilcox wrote: > > > [...] > > >> Ah, yes, that makes perfect sense. Thank you for the explanation. >

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-17 Thread Matthew Wilcox
On Mon, Dec 17, 2018 at 07:51:27PM +0900, Tetsuo Handa wrote: > On 2018/12/17 18:33, Michal Hocko wrote: > > On Sun 16-12-18 19:51:57, Matthew Wilcox wrote: > > [...] > >> Ah, yes, that makes perfect sense. Thank you for the explanation. > >> > >> I wonder if the correct fix, however, is not to mo

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-17 Thread Tetsuo Handa
On 2018/12/17 18:33, Michal Hocko wrote: > On Sun 16-12-18 19:51:57, Matthew Wilcox wrote: > [...] >> Ah, yes, that makes perfect sense. Thank you for the explanation. >> >> I wonder if the correct fix, however, is not to move the check for >> GFP_NOFS in out_of_memory() down to below the check wh

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-17 Thread Michal Hocko
On Sun 16-12-18 19:51:57, Matthew Wilcox wrote: [...] > Ah, yes, that makes perfect sense. Thank you for the explanation. > > I wonder if the correct fix, however, is not to move the check for > GFP_NOFS in out_of_memory() down to below the check whether to kill > the current task. That would so

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-16 Thread Matthew Wilcox
On Sun, Dec 16, 2018 at 05:38:13PM +0800, Hou Tao wrote: > Hi, > > On 2018/12/15 22:38, Matthew Wilcox wrote: > > On Tue, Dec 04, 2018 at 10:08:40AM +0800, Hou Tao wrote: > >> There is no need to disable __GFP_FS in ->readpage: > >> * It's a read-only fs, so there will be no dirty/writeback page a

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-16 Thread Hou Tao
Hi, On 2018/12/15 22:38, Matthew Wilcox wrote: > On Tue, Dec 04, 2018 at 10:08:40AM +0800, Hou Tao wrote: >> There is no need to disable __GFP_FS in ->readpage: >> * It's a read-only fs, so there will be no dirty/writeback page and >> there will be no deadlock against the caller's locked page >>

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-15 Thread Matthew Wilcox
On Tue, Dec 04, 2018 at 10:08:40AM +0800, Hou Tao wrote: > There is no need to disable __GFP_FS in ->readpage: > * It's a read-only fs, so there will be no dirty/writeback page and > there will be no deadlock against the caller's locked page > * It just allocates one page, so compaction will not

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-15 Thread Hou Tao
ping ? On 2018/12/13 10:18, Hou Tao wrote: > ping ? > > On 2018/12/6 9:14, Hou Tao wrote: >> ping ? >> >> On 2018/12/4 10:08, Hou Tao wrote: >>> There is no need to disable __GFP_FS in ->readpage: >>> * It's a read-only fs, so there will be no dirty/writeback page and >>> there will be no deadl

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-12 Thread Hou Tao
ping ? On 2018/12/6 9:14, Hou Tao wrote: > ping ? > > On 2018/12/4 10:08, Hou Tao wrote: >> There is no need to disable __GFP_FS in ->readpage: >> * It's a read-only fs, so there will be no dirty/writeback page and >> there will be no deadlock against the caller's locked page >> * It just alloc

Re: [PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-05 Thread Hou Tao
ping ? On 2018/12/4 10:08, Hou Tao wrote: > There is no need to disable __GFP_FS in ->readpage: > * It's a read-only fs, so there will be no dirty/writeback page and > there will be no deadlock against the caller's locked page > * It just allocates one page, so compaction will not be invoked > *

[PATCH] squashfs: enable __GFP_FS in ->readpage to prevent hang in mem alloc

2018-12-03 Thread Hou Tao
There is no need to disable __GFP_FS in ->readpage: * It's a read-only fs, so there will be no dirty/writeback page and there will be no deadlock against the caller's locked page * It just allocates one page, so compaction will not be invoked * It doesn't take any inode lock, so the reclamation o