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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2374C982CD for ; Thu, 17 Sep 2026 06:03:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ACB336B0092; Thu, 17 Sep 2026 02:03:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA3956B0093; Thu, 17 Sep 2026 02:03:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BAB56B0095; Thu, 17 Sep 2026 02:03:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 78A736B0092 for ; Thu, 17 Sep 2026 02:03:34 -0400 (EDT) Received: from smtpin24.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EC9C880256 for ; Thu, 17 Sep 2026 06:03:33 +0000 (UTC) X-FDA: 85222212306.24.11F0C9D Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf19.hostedemail.com (Postfix) with ESMTP id 2371C1A0006 for ; Thu, 17 Sep 2026 06:03:31 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Wd9u84st; spf=pass (imf19.hostedemail.com: domain of akpm@linux-foundation.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1789625012; b=3FRrSnlBPm1Qsc8osJkkfsOJDULU5Nu6G3ZouA32uclv3GgnZJ/qwCrYbuCMYVPTmjh5I3 xSr6WZUwuuO6dgetP+d7BkSNlGDDGRdyxPOD9BgR3efuA33VrDJx3y3SIUUoWpZrJMGHWe JRjWoTzCocaa0mtXNTaoG4g/9UmQmLk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Wd9u84st; spf=pass (imf19.hostedemail.com: domain of akpm@linux-foundation.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1789625012; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HSrhie3ypuW83vFReYxjzy5OGcpm75lW5CqYyN+TEsk=; b=OGL9LdT12UheBtToFE/PNRRmGcRDrTJgYaAacV+SobilmXq65f1hTcbNt5q4nWNNepnvqV ZFZuVQIqmCuGDYcVH3PLfKvpI7nXVu+TYZQi/57uHrDlLsAFn/FEcPNCo/S7M2O5ct22Vs Q0L0NTn6iQU6SI4alNrOKt2sjvZAHKw= Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4222440254; Thu, 17 Sep 2026 06:03:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95C4D1F000FF; Thu, 17 Sep 2026 06:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1789625011; bh=HSrhie3ypuW83vFReYxjzy5OGcpm75lW5CqYyN+TEsk=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Wd9u84st6s+3ZhZdO82k19nVHM8EAnqO3+U/8oQITZkdGudQybJigXBMhtM6CAyGW baMfzhKJwf9EVmkJ87qdiD1rcmBHgV4FNMaU0FXOgWAzme9oBLXFcOFwQ5Ef7yKHyy /XvF2GFD9UzKCTU0nX38fqf2qtJk3AijlOthZw6k= Date: Wed, 16 Sep 2026 23:03:30 -0700 From: Andrew Morton To: "Arnd Bergmann" Cc: "Arnd Bergmann" , "Johannes Weiner" , "David Hildenbrand (Red Hat)" , "Michal Hocko" , "Qi Zheng" , "Shakeel Butt" , "Lorenzo Stoakes" , "Kairui Song" , "Barry Song" , "Axel Rasmussen" , "Yuanchu Xie" , "Wei Xu" , "Baoquan He" , "Baolin Wang" , "Ridong Chen" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmscan: avoid false-positive -Wuninitialized warning, again Message-Id: <20260916230330.f0923cdb679de0b39d1c5d3a@linux-foundation.org> In-Reply-To: <75939625-482c-464f-83fb-fa12d3e1d79c@app.fastmail.com> References: <20260916083456.4136132-1-arnd@kernel.org> <20260916162816.39f0f33f6a48d30a71be3575@linux-foundation.org> <20260916163044.3daa3811d9b2bf7d958f1f27@linux-foundation.org> <75939625-482c-464f-83fb-fa12d3e1d79c@app.fastmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2371C1A0006 X-Stat-Signature: 8hkx56gkjm61p846x7zc1us8bf7qpnxx X-HE-Tag: 1789625011-479195 X-HE-Meta: U2FsdGVkX18sqGrNLfRx/kFNm+trOzWDPUCYYrBRc4NzIDo3zBcHvakLd2mhyCCXhzINoZiTcKC8oGUYiA1le5yuE3btB1FUzAHnEb+OBwtnPHOr4mQSU0K37qdHZv8RUP4fcoo/NMFUWp3AAaS83qCoDh6pHeo9HMFM2U6XDp0PMaGkLeHmGEIM25uUBL6Gj5DF4VOpJ529T1p1X2C7hDE30S6c5Ds9+2o66I9MVd/PwOX529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Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 17 Sep 2026 07:50:43 +0200 "Arnd Bergmann" wrote: > On Thu, Sep 17, 2026, at 01:30, Andrew Morton wrote: > > On Wed, 16 Sep 2026 16:28:16 -0700 Andrew Morton wrote: > >> > > >> > --- a/mm/vmscan.c > >> > +++ b/mm/vmscan.c > >> > @@ -3274,8 +3274,10 @@ struct ctrl_pos { > >> > int gain; > >> > }; > >> > > >> > -static void read_ctrl_pos(struct lruvec *lruvec, int type, int tier_min, > >> > - int tier_max, int gain, struct ctrl_pos *pos) > >> > +/* __noipa works around gcc-16 warning for uninitizled use of pos->refaulted */ > >> > +static __noipa void read_ctrl_pos(struct lruvec *lruvec, int type, > >> > + int tier_min, int tier_max, int gain, > >> > + struct ctrl_pos *pos) > >> > { > >> > int i; > >> > struct lru_gen_folio *lrugen = &lruvec->lrugen; > >> > >> Current code has changed here somewhat, but I expect the error is still > >> there. I fixed that "uninitizled" while in there. Altered patch is > >> below. > > > > > > Then the build blew up in unexpected ways. gcc-15.2.0. > > > > The failure looks like a legit min() signedness thing which has been > > there quite a while. I'm thinking that __noipa surfaced this for some > > reason? > > Right, I now saw the same thing here on the current linux-next. > > What I found now is that the __noipa is only needed on top of > "mm/mglru: use explicit tier range in read_ctrl_pos()", which was > in next-20260915 but disappeared in next-20260916. This patch > also removed the min(). So we don't need cc:stable? > I think the reason why __noipa causes the warning about min() is > that it prevents the constant propagation into read_ctrl_pos() and > in turn the hack that suppresses warning about mixed types in > minmax.h when both sides are constant. > > Is the mglru series currently expected to make it into 7.4? Yes, "mm/mglru: use explicit tier range in read_ctrl_pos()" is in mm-unstable at present. > If not, I would withdraw my __noipa and hope that the next > round of changes to read_ctrl_pos() does not run into this > problem again. OK, I'll drop "mm/vmscan.c: fix min() signedness mismatch" and shall rely on "mm/mglru: use explicit tier range in read_ctrl_pos()" to fix the min() thing. And I'll stage "mm/vmscan: avoid false-positive -Wuninitialized warning, again". ahead of "mm/mglru: use explicit tier range in read_ctrl_pos()" to fix the build glitch wihout a bisection hole. Does that sound sane?