linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Arjan van de Ven <arjan@fenrus.demon.nl>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>, linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] mm: call into direct reclaim without PF_MEMALLOC set
Date: Wed, 15 Nov 2006 14:24:37 -0800	[thread overview]
Message-ID: <20061115142437.87c4cbe4.akpm@osdl.org> (raw)
In-Reply-To: <1163628739.31358.164.camel@laptopd505.fenrus.org>

On Wed, 15 Nov 2006 23:12:19 +0100
Arjan van de Ven <arjan@fenrus.demon.nl> wrote:

> On Wed, 2006-11-15 at 14:00 -0800, Andrew Morton wrote:
> > On Wed, 15 Nov 2006 22:32:58 +0100
> > Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > 
> > > +			current->flags |= PF_MEMALLOC;
> > >  			try_to_free_pages(zones, GFP_NOFS);
> > > +			current->flags &= ~PF_MEMALLOC;
> > 
> > Sometime, later, in a different patch, we might as well suck that into
> > try_to_free_pages() itself.   Along with nice comment explaining
> > what it means and WARN_ON(current->flags & PF_MEMALLOC).
> 
> also I've seen a few cases where this will break.
> If you already *have* PF_MEMALLOC you'd lose it here; it's generally a
> mistake to do so. It's a lot safer to save the old value and restore
> it...

it does:

+		if (*zones && !(current->flags & PF_MEMALLOC)) {
+			current->flags |= PF_MEMALLOC;
 			try_to_free_pages(zones, GFP_NOFS);
+			current->flags &= ~PF_MEMALLOC;
+		}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-11-15 22:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-15 19:25 Peter Zijlstra
2006-11-15 20:42 ` Andrew Morton
2006-11-15 21:23   ` [PATCH] " Peter Zijlstra
2006-11-15 21:32     ` Andrew Morton
     [not found]   ` <1163625058.5968.64.camel@twins>
     [not found]     ` <20061115132340.3cbf4008.akpm@osdl.org>
2006-11-15 21:32       ` Peter Zijlstra
2006-11-15 22:00         ` Andrew Morton
2006-11-15 22:12           ` Arjan van de Ven
2006-11-15 22:24             ` Andrew Morton [this message]
2006-11-16  9:52           ` [PATCH] mm: cleanup and document reclaim recursion Peter Zijlstra
2006-11-17  0:16             ` Andrew Morton
2006-11-17  8:31               ` Peter Zijlstra
2006-11-17 12:18               ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061115142437.87c4cbe4.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=arjan@fenrus.demon.nl \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox