]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm, vmstat: remove the NR_WRITEBACK_TEMP node_stat_item counter
authorVlastimil Babka <vbabka@suse.cz>
Wed, 25 Jun 2025 15:51:52 +0000 (17:51 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 01:59:47 +0000 (18:59 -0700)
The only user of the counter (FUSE) was removed in commit 0c58a97f919c
("fuse: remove tmp folio for writebacks and internal rb tree") so follow
the established pattern of removing the counter and hardcoding 0 in
meminfo output, as done recently with NR_BOUNCE.  Update documentation for
procfs, including for the value for Bounce that was missed when removing
its counter.

Also remove the mention of NR_WRITEBACK_TEMP implications from a comment
in wb_position_ratio(). The rest of the comment there about fuse setting
bdi->max_ratio to 1% is still correct.

[vbabka@suse.cz: v2]
Link: https://lkml.kernel.org/r/5a848e15-6a57-4ecb-a015-d4f358b8a5d3@suse.cz
Link: https://lkml.kernel.org/r/20250625-nr_writeback_removal-v1-1-7f2a0df70faa@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Jeffle Xu <jefflexu@linux.alibaba.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Joanne Koong <joannelkoong@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kirill A. Shuemov <kirill.shutemov@linux.intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Maxim Patlasov <mpatlasov@parallels.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Miklos Szeredi <mszeredi@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zach O'Keefe <zokeefe@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/filesystems/proc.rst
drivers/base/node.c
fs/proc/meminfo.c
include/linux/mmzone.h
mm/page-writeback.c
mm/show_mem.c
mm/vmstat.c

index 5236cb52e357dcd00496b26be8578e1dec0a345e..2971551b7235345c9a7ec3c84a87a16adcda5901 100644 (file)
@@ -1196,12 +1196,14 @@ SecPageTables
               Memory consumed by secondary page tables, this currently includes
               KVM mmu and IOMMU allocations on x86 and arm64.
 NFS_Unstable
-              Always zero. Previous counted pages which had been written to
+              Always zero. Previously counted pages which had been written to
               the server, but has not been committed to stable storage.
 Bounce
-              Memory used for block device "bounce buffers"
+              Always zero. Previously memory used for block device
+              "bounce buffers".
 WritebackTmp
-              Memory used by FUSE for temporary writeback buffers
+              Always zero. Previously memory used by FUSE for temporary
+              writeback buffers.
 CommitLimit
               Based on the overcommit ratio ('vm.overcommit_ratio'),
               this is the total amount of  memory currently available to
index 6d66382dae6533a0c8481f72ad67c35021e331d3..e434cb260e6182468e0d617b559134c6fbe128f4 100644 (file)
@@ -500,7 +500,7 @@ static ssize_t node_read_meminfo(struct device *dev,
                             nid, K(node_page_state(pgdat, NR_SECONDARY_PAGETABLE)),
                             nid, 0UL,
                             nid, 0UL,
-                            nid, K(node_page_state(pgdat, NR_WRITEBACK_TEMP)),
+                            nid, 0UL,
                             nid, K(sreclaimable +
                                    node_page_state(pgdat, NR_KERNEL_MISC_RECLAIMABLE)),
                             nid, K(sreclaimable + sunreclaimable),
index bc2bc60c36ccc1dab8913913056f5ff20b448490..a458f1e112fdbc63019239a79ce39c5576b5f963 100644 (file)
@@ -121,8 +121,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 
        show_val_kb(m, "NFS_Unstable:   ", 0);
        show_val_kb(m, "Bounce:         ", 0);
-       show_val_kb(m, "WritebackTmp:   ",
-                   global_node_page_state(NR_WRITEBACK_TEMP));
+       show_val_kb(m, "WritebackTmp:   ", 0);
        show_val_kb(m, "CommitLimit:    ", vm_commit_limit());
        show_val_kb(m, "Committed_AS:   ", committed);
        seq_printf(m, "VmallocTotal:   %8lu kB\n",
index 1d1bb2b7f40d25b430932c9ef9096d97bf1c29de..0c5da9141983b795018c0aa2457b065507416564 100644 (file)
@@ -206,7 +206,6 @@ enum node_stat_item {
        NR_FILE_PAGES,
        NR_FILE_DIRTY,
        NR_WRITEBACK,
-       NR_WRITEBACK_TEMP,      /* Writeback using temporary buffers */
        NR_SHMEM,               /* shmem pages (included tmpfs/GEM pages) */
        NR_SHMEM_THPS,
        NR_SHMEM_PMDMAPPED,
index 72b0ff0d4bae1e7be5c1f5963e2d7a4bbc7a05c0..3e248d1c3969be82fb2f460f840ce47124d21645 100644 (file)
@@ -1101,9 +1101,7 @@ static void wb_position_ratio(struct dirty_throttle_control *dtc)
         * such filesystems balance_dirty_pages always checks wb counters
         * against wb limits. Even if global "nr_dirty" is under "freerun".
         * This is especially important for fuse which sets bdi->max_ratio to
-        * 1% by default. Without strictlimit feature, fuse writeback may
-        * consume arbitrary amount of RAM because it is accounted in
-        * NR_WRITEBACK_TEMP which is not involved in calculating "nr_dirty".
+        * 1% by default.
         *
         * Here, in wb_position_ratio(), we calculate pos_ratio based on
         * two values: wb_dirty and wb_thresh. Let's consider an example:
index 0cf8bf5d832d6b339b4c9a6c7b8b3ab41683bcfe..41999e94a56d623726ea92f3f38785e8b218afe5 100644 (file)
@@ -246,7 +246,6 @@ static void show_free_areas(unsigned int filter, nodemask_t *nodemask, int max_z
                        " shmem_pmdmapped:%lukB"
                        " anon_thp:%lukB"
 #endif
-                       " writeback_tmp:%lukB"
                        " kernel_stack:%lukB"
 #ifdef CONFIG_SHADOW_CALL_STACK
                        " shadow_call_stack:%lukB"
@@ -273,7 +272,6 @@ static void show_free_areas(unsigned int filter, nodemask_t *nodemask, int max_z
                        K(node_page_state(pgdat, NR_SHMEM_PMDMAPPED)),
                        K(node_page_state(pgdat, NR_ANON_THPS)),
 #endif
-                       K(node_page_state(pgdat, NR_WRITEBACK_TEMP)),
                        node_page_state(pgdat, NR_KERNEL_STACK_KB),
 #ifdef CONFIG_SHADOW_CALL_STACK
                        node_page_state(pgdat, NR_KERNEL_SCS_KB),
index c250eeba0f16b8155023516b26e01bd66aa5ca0e..71cd1ceba191e15e74255a3eaf5d43a48f26eb34 100644 (file)
@@ -1251,7 +1251,6 @@ const char * const vmstat_text[] = {
        [I(NR_FILE_PAGES)]                      = "nr_file_pages",
        [I(NR_FILE_DIRTY)]                      = "nr_dirty",
        [I(NR_WRITEBACK)]                       = "nr_writeback",
-       [I(NR_WRITEBACK_TEMP)]                  = "nr_writeback_temp",
        [I(NR_SHMEM)]                           = "nr_shmem",
        [I(NR_SHMEM_THPS)]                      = "nr_shmem_hugepages",
        [I(NR_SHMEM_PMDMAPPED)]                 = "nr_shmem_pmdmapped",