Index: linux-2.6.20-rc3/mm/page-writeback.c =================================================================== --- linux-2.6.20-rc3.orig/mm/page-writeback.c 2007-01-05 13:34:02.000000000 -0600 +++ linux-2.6.20-rc3/mm/page-writeback.c 2007-01-05 14:28:46.326718502 -0600 @@ -142,19 +142,11 @@ get_dirty_limits(struct dirty_limits *dl unsigned long nr_mapped; struct task_struct *tsk; +#ifdef CONFIG_CPUSETS /* - * Respect the boundaries of the current cpuset otherwise dirty - * writeout will not work properly in a cpuset. + * Calculate the ratios relative to the current cpuset if necessary. */ - if (likely(nodes_subset(node_online_map, cpuset_current_mems_allowed))) { - dl->nr_dirty = global_page_state(NR_FILE_DIRTY); - dl->nr_unstable = global_page_state(NR_UNSTABLE_NFS); - dl->nr_writeback = global_page_state(NR_WRITEBACK); - available_memory = vm_total_pages; - high_memory = totalhigh_pages; - nr_mapped = global_page_state(NR_FILE_MAPPED) + - global_page_state(NR_ANON_PAGES); - } else { + if (!likely(nodes_subset(node_online_map, cpuset_current_mems_allowed))) { int node; memset(dl, 0, sizeof(struct dirty_limits)); @@ -175,8 +167,18 @@ get_dirty_limits(struct dirty_limits *dl nr_mapped += node_page_state(node, NR_FILE_MAPPED) + node_page_state(node, NR_ANON_PAGES); } + } else +#endif + { + /* Global dirty ratio */ + dl->nr_dirty = global_page_state(NR_FILE_DIRTY); + dl->nr_unstable = global_page_state(NR_UNSTABLE_NFS); + dl->nr_writeback = global_page_state(NR_WRITEBACK); + available_memory = vm_total_pages; + high_memory = totalhigh_pages; + nr_mapped = global_page_state(NR_FILE_MAPPED) + + global_page_state(NR_ANON_PAGES); } - #ifdef CONFIG_HIGHMEM /* * If this mapping can only allocate from low memory,