Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Documentation: zram: update IDLE pages tracking documentation

Move IDLE pages tracking into a separate chapter because there are
multiple features that use (or depend on) it either in built-in variant
("mark all") or in extended variant (ac-time tracking).

In addition, recompression doesn't require memory tracking to be enabled
in order to be able to perform idle recompression.

Link: https://lkml.kernel.org/r/20250416042833.3858827-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reported-by: Shin Kawamura <kawasin@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Sergey Senozhatsky and committed by
Andrew Morton
b05f8d7e 4a34c584

+21 -20
+21 -20
Documentation/admin-guide/blockdev/zram.rst
··· 317 317 Optional Feature 318 318 ================ 319 319 320 + IDLE pages tracking 321 + ------------------- 322 + 323 + zram has built-in support for idle pages tracking (that is, allocated but 324 + not used pages). This feature is useful for e.g. zram writeback and 325 + recompression. In order to mark pages as idle, execute the following command:: 326 + 327 + echo all > /sys/block/zramX/idle 328 + 329 + This will mark all allocated zram pages as idle. The idle mark will be 330 + removed only when the page (block) is accessed (e.g. overwritten or freed). 331 + Additionally, when CONFIG_ZRAM_TRACK_ENTRY_ACTIME is enabled, pages can be 332 + marked as idle based on how many seconds have passed since the last access to 333 + a particular zram page:: 334 + 335 + echo 86400 > /sys/block/zramX/idle 336 + 337 + In this example, all pages which haven't been accessed in more than 86400 338 + seconds (one day) will be marked idle. 339 + 320 340 writeback 321 341 --------- 322 342 ··· 351 331 352 332 echo huge > /sys/block/zramX/writeback 353 333 354 - To use idle page writeback, first, user need to declare zram pages 355 - as idle:: 356 - 357 - echo all > /sys/block/zramX/idle 358 - 359 - From now on, any pages on zram are idle pages. The idle mark 360 - will be removed until someone requests access of the block. 361 - IOW, unless there is access request, those pages are still idle pages. 362 - Additionally, when CONFIG_ZRAM_TRACK_ENTRY_ACTIME is enabled pages can be 363 - marked as idle based on how long (in seconds) it's been since they were 364 - last accessed:: 365 - 366 - echo 86400 > /sys/block/zramX/idle 367 - 368 - In this example all pages which haven't been accessed in more than 86400 369 - seconds (one day) will be marked idle. 370 - 371 - Admin can request writeback of those idle pages at right timing via:: 334 + Admin can request writeback of idle pages at right timing via:: 372 335 373 336 echo idle > /sys/block/zramX/writeback 374 337 ··· 501 498 attempt to recompress::: 502 499 503 500 echo "type=huge_idle max_pages=42" > /sys/block/zramX/recompress 504 - 505 - Recompression of idle pages requires memory tracking. 506 501 507 502 During re-compression for every page, that matches re-compression criteria, 508 503 ZRAM iterates the list of registered alternative compression algorithms in