From: Vlastimil Babka <vbabka@suse.cz>
To: yalin wang <yalin.wang2010@gmail.com>,
akpm@linux-foundation.org, mhocko@suse.cz,
vdavydov@parallels.com, hannes@cmpxchg.org,
mgorman@techsingularity.net, tj@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: change may_enter_fs check condition
Date: Fri, 13 Nov 2015 13:01:16 +0100 [thread overview]
Message-ID: <5645D10C.701@suse.cz> (raw)
In-Reply-To: <1447415255-832-1-git-send-email-yalin.wang2010@gmail.com>
On 11/13/2015 12:47 PM, yalin wang wrote:
> Add page_is_file_cache() for __GFP_FS check,
> otherwise, a Pageswapcache() && PageDirty() page can always be write
> back if the gfp flag is __GFP_FS, this is not the expected behavior.
I'm not sure I understand your point correctly *), but you seem to imply
that there would be an allocation that has __GFP_FS but doesn't have
__GFP_IO? Are there such allocations and does it make sense?
*) It helps to state which problem you actually observed and are trying
to fix. Or was this found by code inspection? In that case describe the
theoretical problem, as "expected behavior" isn't always understood by
everyone the same.
> Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
> ---
> mm/vmscan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index bd2918e..f8fc8c1 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -930,7 +930,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
> if (page_mapped(page) || PageSwapCache(page))
> sc->nr_scanned++;
>
> - may_enter_fs = (sc->gfp_mask & __GFP_FS) ||
> + may_enter_fs = (page_is_file_cache(page) && (sc->gfp_mask & __GFP_FS)) ||
> (PageSwapCache(page) && (sc->gfp_mask & __GFP_IO));
>
> /*
>
--
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>
next prev parent reply other threads:[~2015-11-13 12:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 11:47 yalin wang
2015-11-13 12:01 ` Vlastimil Babka [this message]
2015-11-13 15:36 ` Michal Hocko
2015-11-16 1:38 ` yalin wang
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=5645D10C.701@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.cz \
--cc=tj@kernel.org \
--cc=vdavydov@parallels.com \
--cc=yalin.wang2010@gmail.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