linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Maninder Singh <maninder1.s@samsung.com>,
	Vaneet Narang <v.narang@samsung.com>,
	Amit Sahrawat <a.sahrawat@samsung.com>,
	Mel Gorman <mgorman@suse.de>, Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH] mm/vmscan: Fix NR_ISOLATED_FILE corruption on 64-bit
Date: Thu, 29 Oct 2020 14:11:03 +0100	[thread overview]
Message-ID: <20201029131103.GG17500@dhcp22.suse.cz> (raw)
In-Reply-To: <20201029032320.1448441-1-npiggin@gmail.com>

On Thu 29-10-20 13:23:20, Nicholas Piggin wrote:
> Previously the negated unsigned long would be cast back to signed long
> which would have the correct negative value. After commit 730ec8c01a2b
> ("mm/vmscan.c: change prototype for shrink_page_list"), the large
> unsigned int converts to a large positive signed long.
> 
> Symptoms include CMA allocations hanging forever holding the cma_mutex
> due to alloc_contig_range->...->isolate_migratepages_block waiting
> forever in "while (unlikely(too_many_isolated(pgdat)))".

Nasty.

> Cc: linux-mm@kvack.org
> Cc: Maninder Singh <maninder1.s@samsung.com>
> Cc: Vaneet Narang <v.narang@samsung.com>
> Cc: Maninder Singh <maninder1.s@samsung.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Amit Sahrawat <a.sahrawat@samsung.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Fixes: 730ec8c01a2b ("mm/vmscan.c: change prototype for shrink_page_list")
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>  mm/vmscan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 1b8f0e059767..92c507bacf09 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1516,7 +1516,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
>  	nr_reclaimed = shrink_page_list(&clean_pages, zone->zone_pgdat, &sc,
>  			TTU_IGNORE_ACCESS, &stat, true);
>  	list_splice(&clean_pages, page_list);
> -	mod_node_page_state(zone->zone_pgdat, NR_ISOLATED_FILE, -nr_reclaimed);
> +	mod_node_page_state(zone->zone_pgdat, NR_ISOLATED_FILE, -(long)nr_reclaimed);
>  	/*
>  	 * Since lazyfree pages are isolated from file LRU from the beginning,
>  	 * they will rotate back to anonymous LRU in the end if it failed to

You want the same also for -stat.nr_lazyfree_fail right?

-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2020-10-29 13:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29  3:23 Nicholas Piggin
2020-10-29 13:11 ` Michal Hocko [this message]
2020-10-30  5:25   ` Andrew Morton
2020-10-30  7:00     ` Michal Hocko

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=20201029131103.GG17500@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=a.sahrawat@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=maninder1.s@samsung.com \
    --cc=mgorman@suse.de \
    --cc=npiggin@gmail.com \
    --cc=v.narang@samsung.com \
    --cc=vbabka@suse.cz \
    /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