mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Rohland <hans-christoph.rohland@sap.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/9] tmpfs: radix_tree_preloading
Date: Wed, 19 Dec 2007 07:50:49 +0100	[thread overview]
Message-ID: <20071219065049.GA31872@wotan.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0712182204210.27165@blonde.wat.veritas.com>

On Tue, Dec 18, 2007 at 10:05:19PM +0000, Hugh Dickins wrote:
> Nick has observed that shmem.c still uses GFP_ATOMIC when adding to page
> cache or swap cache, without any radix tree preload: so tending to deplete
> emergency reserves of memory.
> 
> GFP_ATOMIC remains appropriate in shmem_writepage's add_to_swap_cache:
> it's being called under memory pressure, so must not wait for more memory
> to become available.  But shmem_unuse_inode now has a window in which it
> can and should preload with GFP_KERNEL, and say GFP_NOWAIT instead of
> GFP_ATOMIC in its add_to_page_cache.
> 
> shmem_getpage is not so straightforward: its filepage/swappage integrity
> relies upon exchanging between caches under spinlock, and it would need a
> lot of restructuring to place the preloads correctly.  Instead, follow
> its pattern of retrying on races: use GFP_NOWAIT instead of GFP_ATOMIC in
> add_to_page_cache, and begin each circuit of the repeat loop with a sleeping
> radix_tree_preload, followed immediately by radix_tree_preload_end - that
> won't guarantee success in the next add_to_page_cache, but doesn't need to.
> 
> And we can then remove that bothersome congestion_wait: when needed,
> it'll automatically get done in the course of the radix_tree_preload.
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>

Looks good to me. Thanks for this!

  reply	other threads:[~2007-12-19  6:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 21:55 [PATCH 0/9] tmpfs: towards unionfs and memcgroups Hugh Dickins
2007-12-18 21:57 ` [PATCH 1/9] tmpfs: move swap_state stats update Hugh Dickins
2007-12-18 21:59 ` [PATCH 2/9] tmpfs: shuffle add_to_swap_caches Hugh Dickins
2007-12-19  1:55   ` Nick Piggin
2007-12-18 22:00 ` [PATCH 3/9] tmpfs: move swap swizzling into shmem Hugh Dickins
2007-12-18 22:01 ` [PATCH 4/9] tmpfs: allow filepage alongside swappage Hugh Dickins
2007-12-18 22:51   ` Erez Zadok
2007-12-19  0:30     ` Hugh Dickins
2007-12-18 22:02 ` [PATCH 5/9] tmpfs: allocate on read when stacked Hugh Dickins
2007-12-18 22:03 ` [PATCH 6/9] tmpfs: make shmem_unuse more preemptible Hugh Dickins
2007-12-18 22:04 ` [PATCH 7/9] tmpfs: open a window in shmem_unuse_inode Hugh Dickins
2007-12-18 22:05 ` [PATCH 8/9] tmpfs: radix_tree_preloading Hugh Dickins
2007-12-19  6:50   ` Nick Piggin [this message]
2007-12-18 22:06 ` [PATCH 9/9] tmpfs: fix shmem_swaplist races Hugh Dickins

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=20071219065049.GA31872@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=hans-christoph.rohland@sap.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome