Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1268895

Re: [PATCH] mm: change may_enter_fs check condition

From Vlastimil Babka <vbabka@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: change may_enter_fs check condition
Date 2015-11-13 13:10 +0100
Message-ID <qull0-6e2-23@gated-at.bofh.it> (permalink)
References <qul1D-5Qz-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: change may_enter_fs check condition yalin wang <yalin.wang2010@gmail.com> - 2015-11-13 12:50 +0100
  Re: [PATCH] mm: change may_enter_fs check condition Vlastimil Babka <vbabka@suse.cz> - 2015-11-13 13:10 +0100
    Re: [PATCH] mm: change may_enter_fs check condition Michal Hocko <mhocko@kernel.org> - 2015-11-13 16:40 +0100
      Re: [PATCH] mm: change may_enter_fs check condition yalin wang <yalin.wang2010@gmail.com> - 2015-11-16 02:40 +0100

csiph-web