All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Fengguang Wu <wfg@mail.ustc.edu.cn>,
	linux-mm@kvack.org
Subject: Re: [PATCH 3/7] swapin needs gfp_mask for loop on tmpfs
Date: Mon, 08 Oct 2007 15:52:59 +0200	[thread overview]
Message-ID: <1191851579.20745.14.camel@twins> (raw)
In-Reply-To: <Pine.LNX.4.64.0710062139490.16223@blonde.wat.veritas.com>

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

On Sat, 2007-10-06 at 21:43 +0100, Hugh Dickins wrote:
> Building in a filesystem on a loop device on a tmpfs file can hang when
> swapping, the loop thread caught in that infamous throttle_vm_writeout.
> 
> In theory this is a long standing problem, which I've either never seen
> in practice, or long ago suppressed the recollection, after discounting
> my load and my tmpfs size as unrealistically high.  But now, with the
> new aops, it has become easy to hang on one machine.
> 
> Loop used to grab_cache_page before the old prepare_write to tmpfs,
> which seems to have been enough to free up some memory for any swapin
> needed; but the new write_begin lets tmpfs find or allocate the page
> (much nicer, since grab_cache_page missed tmpfs pages in swapcache).
> 
> When allocating a fresh page, tmpfs respects loop's mapping_gfp_mask,
> which has __GFP_IO|__GFP_FS stripped off, and throttle_vm_writeout is
> designed to break out when __GFP_IO or GFP_FS is unset; but when tmfps
> swaps in, read_swap_cache_async allocates with GFP_HIGHUSER_MOVABLE
> regardless of the mapping_gfp_mask - hence the hang.
> 
> So, pass gfp_mask down the line from shmem_getpage to shmem_swapin
> to swapin_readahead to read_swap_cache_async to add_to_swap_cache.
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2007-10-08 13:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-06 20:35 [PATCH 0/7] swapin/shmem patches Hugh Dickins
2007-10-06 20:38 ` [PATCH 1/7] swapin_readahead: excise NUMA bogosity Hugh Dickins
2007-10-06 22:43   ` Rik van Riel
2007-10-07 22:05   ` Andi Kleen
2007-10-07 22:37     ` Rik van Riel
2007-10-08 17:31   ` Christoph Lameter
2007-10-08 17:35     ` Rik van Riel
2007-10-08 17:41       ` Christoph Lameter
2007-10-08 17:47         ` Rik van Riel
2007-10-08 17:52           ` Christoph Lameter
2007-10-08 18:48             ` Rik van Riel
2007-10-06 20:39 ` [PATCH 2/7] swapin_readahead: move and rearrange args Hugh Dickins
2007-10-07  2:26   ` Rik van Riel
2007-10-06 20:43 ` [PATCH 3/7] swapin needs gfp_mask for loop on tmpfs Hugh Dickins
2007-10-07 23:23   ` Rik van Riel
2007-10-08 13:52   ` Peter Zijlstra [this message]
2007-10-06 20:45 ` [PATCH 4/7] shmem: SGP_QUICK and SGP_FAULT redundant Hugh Dickins
2007-10-07 23:23   ` Rik van Riel
2007-10-06 20:46 ` [PATCH 5/7] shmem_getpage return page locked Hugh Dickins
2007-10-07  8:01   ` Nick Piggin
2007-10-08 12:05     ` Hugh Dickins
2007-10-08  7:08       ` Nick Piggin
2007-10-08  0:44   ` Rik van Riel
2007-10-06 20:47 ` [PATCH 6/7] shmem_file_write is redundant Hugh Dickins
2007-10-08  0:46   ` Rik van Riel
2007-10-06 20:48 ` [PATCH 7/7] swapin: fix valid_swaphandles defect Hugh Dickins
2007-10-08  1:14   ` Rik van Riel

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=1191851579.20745.14.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-mm@kvack.org \
    --cc=miklos@szeredi.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=wfg@mail.ustc.edu.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.