From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 B22BF7080D for ; Wed, 15 Apr 2026 00:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776214054; cv=none; b=TVllcR11lEaspo6t4neccImr9AFCP9brgHUTM6RTloFcbT25z7xQe4eHB2eG/gNZ7+F3mWmaw9iQOMuAmdZ0GZMQ94FGXH1yOqo/SdmVl1szGyolzll7a747XzGML/8JTmyv2PMAjgUWAKi7kF5TKQgu5nJJOqxu2qnsIqo2t1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776214054; c=relaxed/simple; bh=smPSuObavbCue5dahXJKfF6YF6BNbf/lfuXhlzBkHOM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gIHPQ8Vc3KAuT+ZvExGuSp/QDWIwory/tP2CHvkSSDN2hQUFQPvzlRAXona/YvIn5p7Wj/EXOXmJ2e1eXSp8yYjowzKOBvWbjItJKKwYYxNWOKIaVULCG+G7MVQx7pkCMNqtoWqwaCVVxob9XtZIP5jdNsul6/JJM3g7EN3hK1M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=iiExjr+5; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="iiExjr+5" Message-ID: <6c0ab55e-a687-4ad1-b18e-b4ca97305a44@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1776214051; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lDf0JysG1bA2y77OxrgeizzszHGnVBp+pEg8WZw72Mw=; b=iiExjr+5cyazYBdLoBH2BKE5Gka46VW0z+r9c197tf4RVyo84nfsuVGttJBEWHHZvSNywl EN+qGzgOaW4AOzSSIAxwkJmrvNZm69sW4DFbX+t7PQJBIlD+DhzDPWRNZO+KNmmsoD6wks wgX1p02r1vgBb2Shym8RQoJ+ApLkfio= Date: Wed, 15 Apr 2026 08:47:24 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 0/4] mm/vmstat: simplify folio stat APIs To: Matthew Wilcox Cc: Andrew Morton , linux-mm@kvack.org, Ye Liu , Vlastimil Babka , linux-kernel@vger.kernel.org References: <20260414091527.2970844-1-ye.liu@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Ye Liu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 在 2026/4/14 21:18, Matthew Wilcox 写道: > On Tue, Apr 14, 2026 at 05:15:17PM +0800, Ye Liu wrote: >> From: Ye Liu >> >> This series simplifies folio statistics accounting by: >> 1. Replacing node_stat_mod_folio/zone_stat_mod_folio with more semantic >> add_folio/sub_folio functions >> 2. Removing unused __node_stat_* and __zone_stat_* wrapper functions > > I'm not convinced this is the right approach. We've often computed > folio_nr_pages() for use by several different functions, and you're > making us recompute it. 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. -- Thanks, Ye Liu