From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA0BA30F534 for ; Wed, 15 Apr 2026 03:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776225589; cv=none; b=TPPEEmjm53C4g9BBPPYNIPKAZbgmZ3up7AKY3tnxu4jMIgFLJJ5qXm/v+3Ps/LnEM5nbaQf5+WlF9j3eppFbxGLTjJct3NBGkZ+yfxXumWBiz97jCMmj1tt6y6FzSsz2sn3q3WpXCbpcF7KYa8PbupnHGN22kCpu13JNs9ZWoUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776225589; c=relaxed/simple; bh=deJ1eMufkMgkppgMwS9jJNybBMDiYOzwePdyq36/Yik=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DqVoypzC+t/Q651mwxhMOPfRynZJC9Qrf4qje8dkHEpNH9alqTwyQHUdByl1CEl79YXXw36FNzHoKSjE2TYvi+LVAhnDRcTTLUwaO4pGzQhyLMQqh9XEJm5jql0pwF6NLZjkXzgOkLzhMKxr7Qndo3fAQmUWZPuInfRd+WQ4jZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Jq/g5R/Y; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Jq/g5R/Y" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=deJ1eMufkMgkppgMwS9jJNybBMDiYOzwePdyq36/Yik=; b=Jq/g5R/YS1vYZZcY2Hd/i7PEdD j2SCdeFyko+PbNjASUS7hy1nUARi4AfcbGRxr3jTu5RW00zPMdHOXtkEK4xUQcLpt83nByzzZcwTz RuQCpxNxvlnLuzEOr+NohyQadIYRWAQqDE++xN88qNDaRp2s2zRX2PRBpstik4Vczudwby2/94hco aF4W6UHTP/NqZrgswn2KgnTqryLnEYH2Zrntiw4kfClOk/SpwZsTUbFcQFrCWSUlBYpIVRtZ7ux/Y A7jMa4j/GWT37wulKyEbsKfI/Bjlv6Pe1FNuNE5xJ018X7CZL/RVvih69sBKnTjcEROI6HnOuuZ52 ogNDH55Q==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1wCrPd-0000000Ggrx-0m37; Wed, 15 Apr 2026 03:59:37 +0000 Date: Wed, 15 Apr 2026 04:59:36 +0100 From: Matthew Wilcox To: Ye Liu Cc: Andrew Morton , linux-mm@kvack.org, Ye Liu , Vlastimil Babka , linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/4] mm/vmstat: simplify folio stat APIs Message-ID: References: <20260414091527.2970844-1-ye.liu@linux.dev> <6c0ab55e-a687-4ad1-b18e-b4ca97305a44@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c0ab55e-a687-4ad1-b18e-b4ca97305a44@linux.dev> On Wed, Apr 15, 2026 at 08:47:24AM +0800, Ye Liu wrote: > Thank you for your feedback, Matthew. I acknowledge that this change may > introduce additional calls to folio_nr_pages() in some cases where the > value was previously computed once and reused. However, the new > add_folio/sub_folio functions provide clearer semantics, explicitly > indicating that we're accounting for the entire folio rather than > potentially partial pages. The overhead of recomputing folio_nr_pages() > is minimal in most scenarios, and the improved readability and reduced > argument passing outweigh this concern. I disagree.