Re: [patch] mm: Convert global dirty_exceeded flag to per-nodenode_dirty_exceeded

From: Andrew Morton
Date: Mon Jan 16 2006 - 21:12:11 EST


Ravikiran G Thirumalai <kiran@xxxxxxxxxxxx> wrote:
>
> This is a repost. I did not get any comments when I last posted this
> about a month back. So I guess this patch is all good :)
>

I thought it was fairly ghastly, sorry ;)

> Convert global dirty_exceeded flag to per-node node_dirty_exceeded.
>
> dirty_exceeded ping pongs between nodes in order to force all cpus in
> the system to increase the frequency of calls to balance_dirty_pages.
>
> Currently dirty_exceeded is used by balance_dirty_pages_ratelimited to
> force all CPUs in the system call balance_dirty_pages often, in order to
> reduce the amount of dirty pages in the entire system (based on
> dirty_thresh and one CPU exceeding thee ratelimits). As dirty_exceeded
> is a global variable, it will ping-pong between nodes of a NUMA system
> which is not good.

Did you not test this obvious little optimisation?

--- devel/mm/page-writeback.c~mm-dirty_exceeded-speedup 2006-01-16 18:11:36.000000000 -0800
+++ devel-akpm/mm/page-writeback.c 2006-01-16 18:11:56.000000000 -0800
@@ -212,7 +212,8 @@ static void balance_dirty_pages(struct a
if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
break;

- dirty_exceeded = 1;
+ if (!dirty_exceeded)
+ dirty_exceeded = 1;

/* Note: nr_reclaimable denotes nr_dirty + nr_unstable.
* Unstable writes are a feature of certain networked
@@ -234,7 +235,7 @@ static void balance_dirty_pages(struct a
blk_congestion_wait(WRITE, HZ/10);
}

- if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
+ if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh && dirty_exceeded)
dirty_exceeded = 0;

if (writeback_in_progress(bdi))
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/