From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 071D2C2D0A3 for ; Thu, 29 Oct 2020 13:11:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4CF302075E for ; Thu, 29 Oct 2020 13:11:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Li112LUW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CF302075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 696EA6B006C; Thu, 29 Oct 2020 09:11:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 620586B006E; Thu, 29 Oct 2020 09:11:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E6A16B0070; Thu, 29 Oct 2020 09:11:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 1E3296B006C for ; Thu, 29 Oct 2020 09:11:07 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B1C681EFD for ; Thu, 29 Oct 2020 13:11:06 +0000 (UTC) X-FDA: 77424998532.13.lead39_2412cdc2728d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 97D1618140B67 for ; Thu, 29 Oct 2020 13:11:06 +0000 (UTC) X-HE-Tag: lead39_2412cdc2728d X-Filterd-Recvd-Size: 3477 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 29 Oct 2020 13:11:06 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1603977065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pX5jf/emA6EKn9gHMGJWRFcowhXglWYudgQC/SowmKE=; b=Li112LUWc2WenZ+U4Rao/TbfDeo4VsQ1ff1aEMUObhPQxO01O/mhVCXG3JnuLeEww582hN W4pfqxiMZnWQc3ORDAnL/P332p7mwGVydW6ZsfhOjrh2XrQs/qb4Bg4xK4HB06mNOtqlDb hZJnkste4+h7kEFdLFjfQ0978jwBL7Q= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 05599AEBE; Thu, 29 Oct 2020 13:11:05 +0000 (UTC) Date: Thu, 29 Oct 2020 14:11:03 +0100 From: Michal Hocko To: Nicholas Piggin Cc: Andrew Morton , linux-mm@kvack.org, Maninder Singh , Vaneet Narang , Amit Sahrawat , Mel Gorman , Vlastimil Babka Subject: Re: [PATCH] mm/vmscan: Fix NR_ISOLATED_FILE corruption on 64-bit Message-ID: <20201029131103.GG17500@dhcp22.suse.cz> References: <20201029032320.1448441-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201029032320.1448441-1-npiggin@gmail.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > Cc: Vaneet Narang > Cc: Maninder Singh > Cc: Michal Hocko > Cc: Amit Sahrawat > Cc: Mel Gorman > Cc: Vlastimil Babka > Fixes: 730ec8c01a2b ("mm/vmscan.c: change prototype for shrink_page_list") > Signed-off-by: Nicholas Piggin > --- > 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