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=-16.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,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 2BD6BC4338F for ; Thu, 22 Jul 2021 19:20:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B9E0F60EB2 for ; Thu, 22 Jul 2021 19:20:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B9E0F60EB2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 110026B0036; Thu, 22 Jul 2021 15:20:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C0A96B005D; Thu, 22 Jul 2021 15:20:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F178C6B006C; Thu, 22 Jul 2021 15:20:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id DB5A86B0036 for ; Thu, 22 Jul 2021 15:20:39 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0A461E097 for ; Thu, 22 Jul 2021 19:20:38 +0000 (UTC) X-FDA: 78391190556.34.F293B3B Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf07.hostedemail.com (Postfix) with ESMTP id 903E71000F48 for ; Thu, 22 Jul 2021 19:20:37 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 3166660EB2; Thu, 22 Jul 2021 19:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1626981636; bh=smW1l4MsfkKTgjk4RU2RMllIjFqZyLK4VbWb1L2rLaE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Udwl4uo7YOc4c+Epr/T64PKlo3dAx69RMtjvQPI4FJxw9+jdviURIfFAOXjoYNHsY SeIFTUx3ev9+AJsXpFmTHytWli1pwTQKoWcg4j9uGKL78LPTyaY2op1MiznU+HXoia OChk8kMNxF3ignh2vKTlKaebN+hcpWzW9G6EguMo= Date: Thu, 22 Jul 2021 12:20:35 -0700 From: Andrew Morton To: David Hildenbrand Cc: Nicholas Piggin , Mel Gorman , Yang Shi , linux-mm@kvack.org, Alexey Kardashevskiy Subject: Re: [PATCH] mm/migrate: fix page state accounting type conversion underflow Message-Id: <20210722122035.7e2d051e3339d8e55f9c82b8@linux-foundation.org> In-Reply-To: <1bc9f24a-c6ff-902e-bce0-165c235bb643@redhat.com> References: <20210722054840.501423-1-npiggin@gmail.com> <1bc9f24a-c6ff-902e-bce0-165c235bb643@redhat.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Udwl4uo7; spf=pass (imf07.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam05 X-Stat-Signature: 6jw59diirxtzrksm44tyzqu8iuopc7zx X-Rspamd-Queue-Id: 903E71000F48 X-HE-Tag: 1626981637-419019 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, 22 Jul 2021 09:27:50 +0200 David Hildenbrand wrote: > On 22.07.21 07:48, Nicholas Piggin wrote: > > Similarly to commit 2da9f6305f306 ("mm/vmscan: fix NR_ISOLATED_FILE > > corruption on 64-bit"), fix -ve int -> unsigned int -> long bug. > > > > Reported-by: Alexey Kardashevskiy > > Fixes: c5fc5c3ae0c84 ("mm: migrate: account THP NUMA migration counters correctly") > > Signed-off-by: Nicholas Piggin > > --- > > mm/migrate.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/migrate.c b/mm/migrate.c > > index 34a9ad3e0a4f..7e240437e7d9 100644 > > --- a/mm/migrate.c > > +++ b/mm/migrate.c > > @@ -2068,7 +2068,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, > > LIST_HEAD(migratepages); > > new_page_t *new; > > bool compound; > > - unsigned int nr_pages = thp_nr_pages(page); > > + int nr_pages = thp_nr_pages(page); > > > > /* > > * PTE mapped THP or HugeTLB page can't reach here so the page could > > > > This is too fragile to silently break again IMHO. Should we similarly to > 2da9f6305f306 handle the conversion explicitly inside the > mod_node_page_state() call? And please don't send us off to loo at another commit to understand this one. A full standalone changelog, please. Preferably with a description of user-visible effects. 2da9f6305f306 said "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)))". Is that also the case with this bug?