From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6D482FFF8B for ; Mon, 22 Jun 2026 16:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782145508; cv=none; b=H7/J0sMrDVY7wMqbHB3oh7siPiIZgzRRHgEQrNTCz/Gs+fYQQAgp9KY3m5bg0oiAWfdo1OhJ2iEa1b1QUwd98CHrVqiR5j4UlcC+RsF8/LgsqaS6bvrs4aDkLyI66cxUWWcShqu/Ysh1H4MUyXnKWKbIOGkue5y5g00GhkroQFE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782145508; c=relaxed/simple; bh=Pqc4jM+GBUi93/Y6w+cgK7Vc7OZCkjCZX3cJzwQfJHY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JFB5MxljKXGc2VVbBhtNS9y1b4DHTF7gx/1icPVp2rtTwKH0J2Rwn28zlThCtoRNlLvMW2ckEHEdZTspja71id4YMWZU2/BGE9EtYI9hozD038RuYv2Kh2+FwTG9meFEN9EnbNNW9/FffzHWeCvCUEnh4k/CBjbvT47InDVlRlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ZtAuhLkc; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ZtAuhLkc" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-462cdb88d01so38362f8f.0 for ; Mon, 22 Jun 2026 09:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1782145505; x=1782750305; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=sMLIt0eZRojMqZhfsI3oKKF+5t4VTIJSxwMeV7ztxpE=; b=ZtAuhLkclasew6/nGBdlwpjGegdiG3NWkBWGE8/UcFAe88OA1z+mm535DkIHYi1bYW KKLCrIb8Ww6bhX6zotfQ3fSu8h9tGyOyJLj93M4iwVhw+m+64cq5tUAZDx43TszU4vPd nASQwmQ3iS+JakzbAm0w71Wb9sgPsbxNRwp7CaVpxA2DU2jSM0+nItjkaduMNcoiCOJS 8e/HyFNkHb/lQw39UeuR1C6k6Tor2c/O1NgHhFdC6AkgfsL5s1XLugUGl+JDHiM51zw9 Llp/5yHSeloBK1mOk0QEzUrgtvJs9neKOmDmnVKgkDlmohNKVTuiBT9y2s/SlnX+sW/i s1yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782145505; x=1782750305; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sMLIt0eZRojMqZhfsI3oKKF+5t4VTIJSxwMeV7ztxpE=; b=RuUAlQhIxX2GkDOqHDoK5Kf2t2i9o4R5aZiIXsK1pfZaR3GDbgjGhQMaItxnTaRgk4 glvcLmVKQGCcY6/WVYqO6J8juO9L8DhYUXGkUAcVXDR2chFfiFgJbn2qNCxv3s2gMpqA ee3twJYdk3iEykzkb81vPvZfjbtJdeiDUtUHP8c9xHcorR8EX3gmuldqdfqh9lYpjFgx NcmbRcdz/xdYEB/ZG8v9d1iFpJab2ZPh4HjEMUQpRnOu6Az08LnO4JoIdVYYkYQd83QG 0hu+YZn8iydM0I4Kig5BgayjPrSSa7HIhpH2ZNTWPrCJBKMwtcvfe0BuK7RQCdvMJiYm /Ffw== X-Forwarded-Encrypted: i=1; AHgh+RqjClp3HQ0koI5h1UqyJuyaYYbcafVGlrAOxA8hRI6xf1vq5IjXiVXiOC50Zu977z0wqUbZYw/VKxIyACI=@vger.kernel.org X-Gm-Message-State: AOJu0YzDtwttZ+FSMBqYH2qFb0PwFswstf3Z7TRbxM73qclLBm0dskWX qT3putKSALL+iaJq+re1CBuBThaZxDz2Wyh6JMV9pEV2ahw1Dm+hlUk+AV7udVCgfp4= X-Gm-Gg: AfdE7clHbHMrliqsIGe1nupGp4Ii/mHLC1U4Io+AgsYmPR/5B0dj9xS+6C979/hREvE psnn0Wnj2so/yQOjIb7BkVhuVRKqES0tFd8Sr6ifcj5i44zyY+oxoA9m7yL5hU4IenzfGe67We3 8vfRbwtdtTquen8/HPN1fz1rb0ap3T9TivYgpPoZ4F1y2c3/u3RbKco7f+q5QKsjZ38dbS+Kzr7 tl+JgQxUQfDeDgLAqNnb814Vc9XJxdISpZzL5oIkRniljY0AFuJNJVKGH2H54xOXXom76xAyNlq GoVhHpDsdri5jCuhuHfkn+ZW1Pxw4C4ESnR9Ph9ZZe1R28pOy1w31YzL81fGIUt+/i6nwnLpBGU IwxjlodjCnpbeF8FsJCzyZR8Z56DMIt91mERGcfz6+lUSKxd1bC0Md5sbgDUuWKgWlTwfwQSC6A AFyeAm2/eSpQRIKiRqcvyaY6jFmOkA X-Received: by 2002:a05:6000:1888:b0:460:21e7:330e with SMTP id ffacd0b85a97d-46a7efb72e0mr336250f8f.10.1782145504382; Mon, 22 Jun 2026 09:25:04 -0700 (PDT) Received: from localhost.localdomain ([62.77.90.70]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-466648c5413sm28550880f8f.11.2026.06.22.09.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2026 09:25:03 -0700 (PDT) Date: Mon, 22 Jun 2026 18:25:01 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Doehyun Baek Cc: Tejun Heo , Jonathan Corbet , Johannes Weiner , Andrew Morton , Shakeel Butt , Roman Gushchin , Yosry Ahmed , Nhat Pham , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Docs/admin-guide/cgroup-v2: fix memory.stat doc details Message-ID: References: <20260620122751.388770-1-doehyunbaek@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fksukxp23q6rzf56" Content-Disposition: inline In-Reply-To: --fksukxp23q6rzf56 Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] Docs/admin-guide/cgroup-v2: fix memory.stat doc details MIME-Version: 1.0 On Mon, Jun 22, 2026 at 05:26:53PM +0200, Doehyun Baek wrote: > However, both zswapped and zswap_incomp are memory_stats[] entries, so > memory.stat prints them through memcg_page_state_output(). Since > MEMCG_ZSWAP_INCOMP is not special-cased as a raw count, the stored page > count is multiplied by the default PAGE_SIZE unit and exported as bytes. >=20 > unsigned long memcg_page_state_output(struct mem_cgroup *memcg, int i= tem) > { > return memcg_page_state(memcg, item) * > memcg_page_state_output_unit(item); > } Ah, I messed up how memcg_page_state_output_unit() is used. The printed values are amounts (in bytes). > Separately, this matches the existing documentation style for zswapped, > whose exported value is described as a memory amount: >=20 > zswapped > Amount of application memory swapped out to zswap. >=20 > Since zswap_incomp follows the same memory.stat output path, I think its > documentation should describe the exported value as a memory amount too. >=20 > I also boot-tested this in QEMU with the current tree and zswap enabled. > With incompressible pages pushed into zswap, memory.stat showed: >=20 > zswap 87822336 > zswapped 87822336 > zswap_incomp 87822336 Thanks for the test and for the fix! >=20 > The zswap_incomp value there is byte-valued; it is not a plain page > count. It also matches zswapped in this all-incompressible case, which > is consistent with both being exported as memory amounts. Acked-by: Michal Koutn=FD --fksukxp23q6rzf56 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJEEABYKADkWIQRCE24Fn/AcRjnLivR+PQLnlNv4CAUCajlh2RsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDIACgkQfj0C55Tb+AjefwD+NV/VDPrTB56lm0tTV9Bx 3LNony3pBqJ3qGqO0IvMxvAA/AjgY0KM15uzvd2GJiB21yMY0AXrJOboe9eQq9sh BpQM =ybGu -----END PGP SIGNATURE----- --fksukxp23q6rzf56--