Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1e7a8fd authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

[PATCH] zoned vm counters: conversion of nr_dirty to per zone counter



This makes nr_dirty a per zone counter.  Looping over all processors is
avoided during writeback state determination.

The counter aggregation for nr_dirty had to be undone in the NFS layer since
we summed up the page counts from multiple zones.  Someone more familiar with
NFS should probably review what I have done.

[akpm@osdl.org: bugfix]
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent df849a15
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ void show_mem(void)
	printk(KERN_INFO "%d pages swap cached\n", cached);

	get_page_state(&ps);
	printk(KERN_INFO "%lu pages dirty\n", ps.nr_dirty);
	printk(KERN_INFO "%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
	printk(KERN_INFO "%lu pages writeback\n", ps.nr_writeback);
	printk(KERN_INFO "%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
	printk(KERN_INFO "%lu pages slab\n", global_page_state(NR_SLAB));
+1 −3
Original line number Diff line number Diff line
@@ -50,8 +50,6 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
	__get_zone_counts(&active, &inactive, &free, NODE_DATA(nid));

	/* Check for negative values in these approximate counters */
	if ((long)ps.nr_dirty < 0)
		ps.nr_dirty = 0;
	if ((long)ps.nr_writeback < 0)
		ps.nr_writeback = 0;

@@ -81,7 +79,7 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
		       nid, K(i.freehigh),
		       nid, K(i.totalram - i.totalhigh),
		       nid, K(i.freeram - i.freehigh),
		       nid, K(ps.nr_dirty),
		       nid, K(node_page_state(nid, NR_FILE_DIRTY)),
		       nid, K(ps.nr_writeback),
		       nid, K(node_page_state(nid, NR_FILE_PAGES)),
		       nid, K(node_page_state(nid, NR_FILE_MAPPED)),
+1 −1
Original line number Diff line number Diff line
@@ -852,7 +852,7 @@ int __set_page_dirty_buffers(struct page *page)
		write_lock_irq(&mapping->tree_lock);
		if (page->mapping) {	/* Race with truncate? */
			if (mapping_cap_account_dirty(mapping))
				inc_page_state(nr_dirty);
				__inc_zone_page_state(page, NR_FILE_DIRTY);
			radix_tree_tag_set(&mapping->page_tree,
						page_index(page),
						PAGECACHE_TAG_DIRTY);
+1 −1
Original line number Diff line number Diff line
@@ -464,7 +464,7 @@ void sync_inodes_sb(struct super_block *sb, int wait)
		.range_start	= 0,
		.range_end	= LLONG_MAX,
	};
	unsigned long nr_dirty = read_page_state(nr_dirty);
	unsigned long nr_dirty = global_page_state(NR_FILE_DIRTY);
	unsigned long nr_unstable = read_page_state(nr_unstable);

	wbc.nr_to_write = nr_dirty + nr_unstable +
+1 −0
Original line number Diff line number Diff line
@@ -315,6 +315,7 @@ nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst,
						req->wb_index, NFS_PAGE_TAG_DIRTY);
				nfs_list_remove_request(req);
				nfs_list_add_request(req, dst);
				dec_zone_page_state(req->wb_page, NR_FILE_DIRTY);
				res++;
			}
		}
Loading