Re: [PATCH 10/14] Conversion of nr_dirty to per zone counter

Christoph Lameter
2006-06-24T20:42:05Z

On Sat, 24 Jun 2006, Andrew Morton wrote:

> > 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.
>
> After fixing all the bugs, and with just a trivial, trivial, trivial amount
> of testing, the NFS unstable pages count goes negative and the machine
> hangs in balance_dirty_pages().

Ahh... SMP / NUMA configurations may mask a problem here by returning
counters <0 as 0. I did not do this specific test on an UP system when
I chased down the NFS counter issues. When I tested this on SMP/NUMA
NR_UNSTABLE correctly went up and down while copying a file.

On a UP system the counters do not have deltas and therefore no <0
checking is necessary. I guess we expose the problem that way.

> Christoph, this just isn't good enough and we need to do something
> significant to reduce the number of compilation errors and runtime bugs
> which you keep on sending.

I should probably switch my main development environment to be exactly
like yours so that bugs that are trivial to you are also trivial to me.
So need to set up a i386 development machine I guess.
r
But them my company would like to have the major development platform to
be IA64.

I hope to have a fix soon .... This only surfaces on UP as far as I can
tell.

Temporary safe fix if its urgent (this messes up inter zone NR_UNSTABLE
accounting but there is nothing that uses zone specific NR_UNSTABLE
yet)

Index: linux-2.6.17/fs/nfs/pagelist.c
===================================================================
--- linux-2.6.17.orig/fs/nfs/pagelist.c 2006-06-24 03:50:10.000000000 -0700
+++ linux-2.6.17/fs/nfs/pagelist.c 2006-06-24 04:11:17.000000000 -0700
@@ -154,7 +154,6 @@
{
struct page *page = req->wb_page;
if (page != NULL) {
- dec_zone_page_state(page, NR_UNSTABLE_NFS);
page_cache_release(page);
req->wb_page = NULL;
}
Index: linux-2.6.17/fs/nfs/write.c
===================================================================
--- linux-2.6.17.orig/fs/nfs/write.c 2006-06-24 03:49:04.000000000 -0700
+++ linux-2.6.17/fs/nfs/write.c 2006-06-24 04:04:21.000000000 -0700
@@ -1424,6 +1424,9 @@
next:
if (req->wb_page)
dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
+ else /* Page is gone but we do not know which zone so use
+ * the zone of ZERO_PAGE for now */
+ dec_zone_page_state(ZERO_PAGE(0), NR_UNSTABLE_NFS);
nfs_clear_page_writeback(req);