lkml.org 
[lkml]   [2011]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 24/32] dlm: dlm workqueues aren't used in memory reclaim path
From
Date
Hi,

On Mon, 2011-01-03 at 15:27 +0100, Tejun Heo wrote:
> Hello again,
>
> On Mon, Jan 03, 2011 at 02:21:29PM +0000, Steven Whitehouse wrote:
> > > Ooh, I see. Hmmm... maybe I've asked this before but do you really
> > > need WQ_MEM_RECLAIM there? Is dlm used during memory reclaim?
> >
> > Yes, it is in case of deallocation of inodes, so we have to be careful
> > about that,
>
> I see. I'm still slightly unsure about the WQ_MEM_RECLAIM rules when
> it comes to distributed file systems and stuff related to them, but I
> think it basically comes down to whether the code can be in the swap
> path or not. e.g. for nfs backed write shared mapped files, nfs
> definitely can be used during memory reclaim _but_ it's not guaranteed
> to make forward progress under memory pressure and thus can't be
> depended upon and shouldn't be used for swap. IOW, it may free memory
> but it's not in the critical path which should guarantee forward
> progress. Isn't dlm the same case?
>
> Thank you.
>

No, the issue arises in case an inode is being ejected from cache with a
0 link count (and this need deallocation). At this point the dlm is
required in order to coordinate which node will perform the
deallocation, but if it blocks on memory reclaim (via the fs, so
GFP_NOFS is ok, but GFP_KERNEL is not) then it can land up calling back
into the fs via a shrink of the dcache which can potentially then also
call back into the dlm.

Since there is no workqueue option to indicate that GFP_NOFS is ok, but
GFP_KERNEL is not, I think in the workqueue case we must mark it as
WQ_MEM_RECLAIM. So far as I can tell thats a limitation of task creation
which was the reason for the pre-allocated rescuer thread. I'd rather be
safe than sorry in this case,

Steve.




\
 
 \ /
  Last update: 2011-01-03 15:41    [from the cache]
©2003-2011 Jasper Spaans