Fix NR_UNSTABLE_NFS accounting Move the decrement of NR_UNSTABLE higher in the loop where the page is still available and get rid of the old hokus pokus. Tested on: NUMA IA64 and a x86_64 single processor configuration. Signed-off-by: Christoph Lameter Index: linux-2.6.17-mm1/fs/nfs/pagelist.c =================================================================== --- linux-2.6.17-mm1.orig/fs/nfs/pagelist.c 2006-06-24 10:25:25.787101004 -0700 +++ linux-2.6.17-mm1/fs/nfs/pagelist.c 2006-06-24 11:58:54.579382227 -0700 @@ -154,7 +154,6 @@ void nfs_clear_request(struct nfs_page * { 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-mm1/fs/nfs/write.c =================================================================== --- linux-2.6.17-mm1.orig/fs/nfs/write.c 2006-06-24 10:25:25.781241992 -0700 +++ linux-2.6.17-mm1/fs/nfs/write.c 2006-06-24 13:34:59.385737173 -0700 @@ -1397,6 +1397,7 @@ static void nfs_commit_done(struct rpc_t while (!list_empty(&data->pages)) { req = nfs_list_entry(data->pages.next); nfs_list_remove_request(req); + dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); dprintk("NFS: commit (%s/%Ld %d@%Ld)", req->wb_context->dentry->d_inode->i_sb->s_id, @@ -1422,8 +1423,6 @@ static void nfs_commit_done(struct rpc_t dprintk(" mismatch\n"); nfs_mark_request_dirty(req); next: - if (req->wb_page) - dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); nfs_clear_page_writeback(req); } }