mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Andrew Morton <akpm@zip.com.au>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [patch] don't allocate ratnodes under PF_MEMALLOC
Date: Sat, 13 Apr 2002 12:32:44 +0100	[thread overview]
Message-ID: <20020413123244.A4470@infradead.org> (raw)
In-Reply-To: <3CB7D75F.FEE95D28@zip.com.au>

>  
>  /*
> + * On the swap_out path, the radix-tree node allocations are performing
> + * GFP_ATOMIC allocations under PF_MEMALLOC.  They can completely
> + * exhaust the page allocator.  This is bad; some pages should be left
> + * available for the I/O system to start sending the swapcache contents
> + * to disk.
> + *
> + * So PF_MEMALLOC is dropped here.  This causes the slab allocations to fail
> + * earlier, so radix-tree nodes will then be allocated from the mempool
> + * reserves.
> + */
> +static inline int
> +swap_out_add_to_swap_cache(struct page *page, swp_entry_t entry)
> +{
> +	int flags = current->flags;
> +	int ret;
> +
> +	current->flags &= ~PF_MEMALLOC;
> +	ret = add_to_swap_cache(page, entry);
> +	current->flags = flags;
> +	return ret;
> +}

I don't like this soloution very - I think porting th add_to_swap() logic
from -rmap and implementing the flags fiddling in that function makes
more sense.  I will do so once a -pre4 is out to resync.

	Christoph


  reply	other threads:[~2002-04-13 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-13  6:59 Andrew Morton
2002-04-13 11:32 ` Christoph Hellwig [this message]
2002-04-13 17:13   ` Christoph Hellwig

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=20020413123244.A4470@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®