From nobody Mon Dec 1 22:05:43 2025 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 B0B6D3019C3 for ; Mon, 1 Dec 2025 09:48:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764582496; cv=none; b=KjwfM1tWuJzRjEPKOfcRW8TEmk3DJYpzDNzsmmpRKB8jX+M1DgOuEJ6bmqnA9gtAZ+cE1wsTq4VOwvbml3dIE5XU25gaMataLptB9KdDR5l6Igw3NJHXYAGYVmr7OaNGSYvKIcp5o+jquaI6juMf0/73MonHbp6dVzIDvHS5q7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764582496; c=relaxed/simple; bh=fhPPnuNbDyoEke+x2rMjuYapNn/Kl3pDEdUNL8/gOpE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EQjZRjI96A2UFrzNax6Jzg0nlzAfCm5BRy7trYAOjXb2jnC//4DxDXQC7KVJLKAlcc74y7Q5QBLZVysJpVp6tv9+zWAB9zLf3LclRsxWdh2TLgaMACk7fu3zrPo8NPBOppDvfwHh9++2VjTplE21GUC/Xvlrch95J18krtIFehY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=HYMayj4n; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HYMayj4n" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7aae5f2633dso4730326b3a.3 for ; Mon, 01 Dec 2025 01:48:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1764582494; x=1765187294; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ft2UmGA5efiA6Tnkdeu/pt2sAJb70nd3fcBnsirWxOw=; b=HYMayj4nVLxROdgZHB0EsVR2TRUEb1RrBAjeyZr1O5IZCCbCbV031hbKg1yBJdjXWx GSyK7SyqiQZlns3aJMqwLb5onsI+AAR7LLSC2I1sc1srVOxp/UCxrU0C524sULBvKeM/ 398SvwRlprK0KQsJq+DmDS7gq3K1O4NN/FpL0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764582494; x=1765187294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ft2UmGA5efiA6Tnkdeu/pt2sAJb70nd3fcBnsirWxOw=; b=CHyl3I8BbbDUECIh/1ND9iJtB275/9dedVlhCmTqV5flFAZvJNDmtOxsYlg1UlFHwz eWWQKwdo3ErBUUzqqikBJ3YGopyKlV2n7b1ymKwcTi/jAx/BIvIkNSsQu8JwTLqCTot2 siXJf2iAbLu2caoGrVOGvzp7SypJAd9LEQk5jFkhSi8Cu49TMVtRV0dOw34/GuZZrwgw cwNS0RXED1brjzPmULO0nNjfDHMQWYVk9IBAVpx0V3x13pQFA6KyKVNneNwZpVdjEj57 rSkLz+q4rww5jILpL6H//FS6aZ9MHUxelAVVxcDUoBCfVSf+n92RjlGJ/alxcnUGEpE7 dBqQ== X-Forwarded-Encrypted: i=1; AJvYcCWs9va2KEPMqNxuQxxuBOp7521lkMgmq4hE4hvREfgsUCdTyhprfBfsoX+vijlOVOVG2Tpj8jXYbnUyZmY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyv//WF6OMG+ZzqDM+KkLfo1mvUjiEZkVd6EPYP2StLkJvXfqUN Iuf37je6xO2yJndpq1nLl3SyixDAGelEZWXbf2N/99TjMhETj948yVR6+k9rgrHIkw== X-Gm-Gg: ASbGncsogfUGAnvLONtaZCuofUg70Q8cOPSNTO6L9ljrdWB2Cu5t1N7jN4yTL7sSiDD 9ayA878K/X2KxGFRyoqfVcOgpJL7d6v2RYbZox/+6pUy+bkChdDZG6/ybTB/j63HdI2T6BeatX8 +6E6A75e2sic1EowZo5TtTAiHWfaU1eJ7enYawKtwcC7PYXzu6bqZqXiHNHkkvbk0GqwlNRP4Rz aL1rXs1grJ+1k52uRpIqNRGL3d0On0VsfaHTVi5OJsgYkr0uC9gn6FWgmn8awOYF0XtG3pdGqfH HJH08zl+dMDJFwDspVW8/oQ/604x8EIexr68eISfLfJjc4hFXinyPCR7tY7yMwpn3ifu9pnh99R QJK1OdjEdp7aA9rTNBu7pCUaovA1do7l+sFPJVw7wFDi5F/V/frWhEIybrdIUtF3L1lpz0ckx4d 3XNjdjTfLNOi7Ny+RwjkAjnahLCdjsRGV603w3uqy0n4t8iE9SWAtJChGqf33MsW6hlU1fkGpK/ Q== X-Google-Smtp-Source: AGHT+IFr8VXpbsnicegVCTPVhcS5UEK7jUpu+3p79wdFmEMCIo/SsUZlSBzDwoKUtRp+pBy2lth03Q== X-Received: by 2002:a05:6a20:7288:b0:361:3bec:fe28 with SMTP id adf61e73a8af0-3614ed96c9amr43808576637.37.1764582494151; Mon, 01 Dec 2025 01:48:14 -0800 (PST) Received: from tigerii.tok.corp.google.com ([2a00:79e0:2031:6:943c:f651:f00f:2459]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7d15e7db577sm12882074b3a.31.2025.12.01.01.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 01:48:13 -0800 (PST) From: Sergey Senozhatsky To: Andrew Morton , Richard Chang , Minchan Kim Cc: Brian Geffon , David Stevens , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, Sergey Senozhatsky Subject: [PATCHv2 3/7] zram: document writeback_batch_size Date: Mon, 1 Dec 2025 18:47:50 +0900 Message-ID: <20251201094754.4149975-4-senozhatsky@chromium.org> X-Mailer: git-send-email 2.52.0.487.g5c8c507ade-goog In-Reply-To: <20251201094754.4149975-1-senozhatsky@chromium.org> References: <20251201094754.4149975-1-senozhatsky@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add missing writeback_batch_size documentation. Signed-off-by: Sergey Senozhatsky --- Documentation/ABI/testing/sysfs-block-zram | 7 +++++++ Documentation/admin-guide/blockdev/zram.rst | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation/ABI= /testing/sysfs-block-zram index ed10c2e4b5c2..e538d4850d61 100644 --- a/Documentation/ABI/testing/sysfs-block-zram +++ b/Documentation/ABI/testing/sysfs-block-zram @@ -157,3 +157,10 @@ Contact: Richard Chang Description: The writeback_compressed device atrribute toggles compressed writeback feature. + +What: /sys/block/zram/writeback_batch_size +Date: November 2025 +Contact: Sergey Senozhatsky +Description: + The writeback_batch_size device atrribute sets the maximum + number of in-flight writeback operations. diff --git a/Documentation/admin-guide/blockdev/zram.rst b/Documentation/ad= min-guide/blockdev/zram.rst index 9547e4e95979..94bb7f2245ee 100644 --- a/Documentation/admin-guide/blockdev/zram.rst +++ b/Documentation/admin-guide/blockdev/zram.rst @@ -214,6 +214,8 @@ mem_limit WO specifies the maximum amount of m= emory ZRAM can writeback_limit WO specifies the maximum amount of write IO zram can write out to backing device as 4KB unit writeback_limit_enable RW show and set writeback_limit feature +writeback_batch_size RW show and set maximum number of in-flight + writeback operations writeback_compressed RW show and set compressed writeback feature comp_algorithm RW show and change the compression algorithm algorithm_params WO setup compression algorithm parameters @@ -223,7 +225,6 @@ backing_dev RW set up backend storage for zram to wr= ite out idle WO mark allocated slot as idle =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 - User space is advised to use the following files to read the device statis= tics. =20 File /sys/block/zram/stat @@ -447,6 +448,14 @@ this feature, execute:: Note that this feature should be configured before the `zramX` device is initialized. =20 +Depending on backing device storage type, writeback operation may benefit +from a higher number of in-flight write requests (batched writes). The +number of maximum in-flight writeback operations can be configured via +`writeback_batch_size` attribute. To change the default value (which is 3= 2), +execute:: + + $ echo 64 > /sys/block/zramX/writeback_batch_size + If admin wants to measure writeback count in a certain period, they could know it via /sys/block/zram0/bd_stat's 3rd column. =20 --=20 2.52.0.487.g5c8c507ade-goog