From patchwork Thu Oct 29 03:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11865231 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1F5392C for ; Thu, 29 Oct 2020 03:23:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D5E62080D for ; Thu, 29 Oct 2020 03:23:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tkiXSNBd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D5E62080D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 289A16B005C; Wed, 28 Oct 2020 23:23:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 23B416B0062; Wed, 28 Oct 2020 23:23:30 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 102696B0068; Wed, 28 Oct 2020 23:23:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0110.hostedemail.com [216.40.44.110]) by kanga.kvack.org (Postfix) with ESMTP id D36E96B005C for ; Wed, 28 Oct 2020 23:23:29 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 790D682499A8 for ; Thu, 29 Oct 2020 03:23:29 +0000 (UTC) X-FDA: 77423517738.20.sense98_23131fd2728a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 58869180C07A3 for ; Thu, 29 Oct 2020 03:23:29 +0000 (UTC) X-Spam-Summary: 1,0,0,f600036a3f430e23,d41d8cd98f00b204,npiggin@gmail.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1311:1314:1345:1431:1437:1515:1534:1541:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3867:3870:3872:4250:4321:4385:5007:6261:6653:7514:9413:10004:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12895:12986:13069:13311:13357:13846:13894:14096:14181:14384:14394:14687:14721:21080:21324:21433:21444:21451:21627:21666:21990:30054:30070,0,RBL:209.85.210.195:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04ygne3jj99h8maf8nt53t5cggfu9ocn5qj561gt99rz3j1wf673ubahtnydum3.dicjfw7wiqf9aiw5oje4mjp3ogo9h4mmstih4kub8st554kn5cn6s95njkbrpzi.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:70,LUA_SUMMARY:none X-HE-Tag: sense98_23131fd2728a X-Filterd-Recvd-Size: 4635 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Thu, 29 Oct 2020 03:23:28 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id e15so1185689pfh.6 for ; Wed, 28 Oct 2020 20:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i/o5ljPVmcCChZ7Wh0rWdj7YXSxtkw/Oy5559KAO8tM=; b=tkiXSNBdyS1dAvKeSJnvA2hwUa43wJIDD0SKXTjmpcDUNOtZQnU+JJ6mYw9ZdbQ/08 ysW+H1ETtBTlUfhwjGDoW0E6dGWsf3OPrLwBURB/5jKZvvEdCBYCWd8qN2CEA14V+qE/ Ud7QYF3qeEoRRHfQyuhG/JDxYBb/DEfjzeKiCICuP5ZQM/qe51nx8ue0G9p6uoXedEMe ICVXkCTDO4BKzMg4oYqwC7eTeWwgd2p9H1oOiiEVhA7Gt63X8ESUCTquLubco6Q9knqh //rOXupj7BSCakFc3hFnwx2cGA5vBTanu2AuSV3rRW5Y6X4Kh+9qKoCLidjXePTrZIMx 0gyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i/o5ljPVmcCChZ7Wh0rWdj7YXSxtkw/Oy5559KAO8tM=; b=EO5jIPc0lZuXrMwxws9Y8T71Ki7vxpq8bcp5H2MeXG5Av+z3aEpeOsZ7zuRk96YfnP PeuIvoYWi+fEJmbSDCjeysvnHdIFzZ/DrRL7IIC5tOI2/DBz7++1hrMwOZ4mXIY8GPIG xleJXUK/XZhe8HzCr1c41QgwScrG8WslMifHMb31pSH6Lk4cvzr43MzJqvJy7AM/RkLV feahnB5xyI15R3rweEcOUQ0TotEV8U/1IbncCkxXIf5gS9br3UeUhRc/+IiaE9lLrn31 GhhFDerve+5fOE+okNJcngxFPh0bY7Onc0qgHXkzSUEo4U7OKxJF15s8tOR0njdPf3Ez BK+Q== X-Gm-Message-State: AOAM531LhZcRzFkPBeVKYnaFdZw0Wyv3vSqWwyLHa3E160afJDcmMdMh yjqmQ7eiztTkzGIEwFB0Kl8= X-Google-Smtp-Source: ABdhPJzK2NNuBrxSy95KV9ddGGattnjNQOOVj8HdI+OKtuqmRL5JntZE+dvYOsU5MtPtdwRiVwQ1VA== X-Received: by 2002:a17:90a:5292:: with SMTP id w18mr2133073pjh.191.1603941807984; Wed, 28 Oct 2020 20:23:27 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (110-175-152-247.tpgi.com.au. [110.175.152.247]) by smtp.gmail.com with ESMTPSA id s131sm826060pgc.18.2020.10.28.20.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 20:23:27 -0700 (PDT) From: Nicholas Piggin To: Andrew Morton Cc: Nicholas Piggin , linux-mm@kvack.org, Maninder Singh , Vaneet Narang , Michal Hocko , Amit Sahrawat , Mel Gorman , Vlastimil Babka Subject: [PATCH] mm/vmscan: Fix NR_ISOLATED_FILE corruption on 64-bit Date: Thu, 29 Oct 2020 13:23:20 +1000 Message-Id: <20201029032320.1448441-1-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.007498, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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)))". 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 Acked-by: Michal Hocko --- 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