mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] swap 13/13 may_enter_fs?
Date: Tue, 25 Mar 2003 17:12:23 -0800	[thread overview]
Message-ID: <20030325171223.7a2c50ee.akpm@digeo.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0303252222530.12636-100000@localhost.localdomain>

Hugh Dickins <hugh@veritas.com> wrote:
>
> shrink_list's may_enter_fs (may_write_page would be a better name)
> currently reflects that swapcache page I/O won't suffer from FS
> complications, so can be done if __GFP_IO without __GFP_FS; but
> the same is true of a tmpfs page (which is just this stage away
> from being a swapcache page), so check bdi->memory_backed instead.
> 
> ...
>
> +			if (!(gfp_mask & (bdi->memory_backed?
> +					__GFP_IO: __GFP_FS)))
>  				goto keep_locked;

Barf.  I haven't used a question mark operator in ten years, and this is a
fine demonstration of why ;)

I think a feasibly comprehensible transformation would be:

	/*
	 * A comment goes here
	 */
	if (bdi->memory_backed)
		may_enter_fs = gfp_mask & __GFP_IO;
	else
		may_enter_fs = gfp_mask & __GFP_FS;


That being said, this is a bit presumptuous.  PF_MEMALLOC will protect us
from infinite recursion but there are other reasons for GFP_NOFS.

For example, a memory-backed filesystem may be trying to allocate GFP_NOFS
memory while holding filesystem locks which are taken by its writepage.

How about adding a new field to backing_dev_info for this case?  Damned if I
can think of a name for it though.




  reply	other threads:[~2003-03-25 22:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-25 22:10 [PATCH] swap 01/13 no SWAP_ERROR Hugh Dickins
2003-03-25 22:12 ` [PATCH] swap 02/13 !CONFIG_SWAP try_to_unmap Hugh Dickins
2003-03-25 22:13 ` [PATCH] swap 03/13 add_to_swap_cache Hugh Dickins
2003-03-25 22:13 ` [PATCH] swap 04/13 page_convert_anon -ENOMEM Hugh Dickins
2003-03-25 22:14 ` [PATCH] swap 05/13 page_convert_anon unlocking Hugh Dickins
2003-03-25 22:15 ` [PATCH] swap 06/13 wrap below vm_start Hugh Dickins
2003-03-25 22:17 ` [PATCH] swap 07/13 objrmap page_table_lock Hugh Dickins
2003-03-25 22:18 ` [PATCH] swap 08/13 rmap comments Hugh Dickins
2003-03-25 22:19 ` [PATCH] swap 09/13 tmpfs truncation Hugh Dickins
2003-03-25 22:20 ` [PATCH] swap 10/13 tmpfs atomics Hugh Dickins
2003-03-26  0:50   ` Andrew Morton
2003-03-25 22:21 ` [PATCH] swap 11/13 fix unuse_pmd fixme Hugh Dickins
2003-03-25 22:38   ` William Lee Irwin III
2003-03-25 22:22 ` [PATCH] swap 12/13 vm_enough_memory double counts Hugh Dickins
2003-03-25 22:23 ` [PATCH] swap 13/13 may_enter_fs? Hugh Dickins
2003-03-26  1:12   ` Andrew Morton [this message]
2003-03-26 17:22     ` Hugh Dickins
2003-03-27  0:31       ` Andrew Morton
2003-03-27 15:21         ` Hugh Dickins
2003-03-26 18:06     ` Bill Davidsen
2003-03-26 18:42       ` Hugh Dickins
2003-03-27 14:55         ` Bill Davidsen

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=20030325171223.7a2c50ee.akpm@digeo.com \
    --to=akpm@digeo.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

all inboxes | Powered by JetHome®