lkml.org 
[lkml]   [2014]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/vmscan: Do not block forever at shrink_inactive_list().
On Mon, 19 May 2014 22:59:15 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 20 May 2014 10:44:49 +1000 Dave Chinner <david@fromorbit.com> wrote:
>
> > @@ -258,14 +258,23 @@ xfs_bmapi_allocate_worker(
> > struct xfs_bmalloca *args = container_of(work,
> > struct xfs_bmalloca, work);
> > unsigned long pflags;
> > + unsigned long new_pflags = PF_FSTRANS;
> >
> > - /* we are in a transaction context here */
> > - current_set_flags_nested(&pflags, PF_FSTRANS);
> > + /*
> > + * we are in a transaction context here, but may also be doing work
> > + * in kswapd context, and hence we may need to inherit that state
> > + * temporarily to ensure that we don't block waiting for memory reclaim
> > + * in any way.
> > + */
> > + if (args->kswapd)
> > + new_pflags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD;
>
> So current_is_kswapd() returns true for a thread which is not kswapd.
> That's a bit smelly.
>
> Should this thread really be incrementing KSWAPD_INODESTEAL instead of
> PGINODESTEAL, for example? current_is_kswapd() does a range of things,
> only one(?) of which you actually want.
>
> It would be cleaner to create a new PF_ flag to select just that
> behavior. That's a better model than telling the world "I am magic and
> special".

Or a new __GFP_FLAG.

> But we're awfully close to running out of PF_ space and I don't know if
> this ugly justifies consuming a flag.
>


\
 
 \ /
  Last update: 2014-05-20 08:41    [W:0.239 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site