Commit e236a166b2bc437769a9b8b5d19186a3761bde48

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent c2aeacd48c

[PATCH] mm: dirty_exceeded speedup

Ravikiran reports that this variable is bouncing all around nodes on NUMA
machines, causing measurable performance problems.  Fix that up by only
writing to it when it actually changed.

And put it in a new cacheline to prevent it sharing with other things (this
happened).

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 4 additions and 3 deletions Side-by-side Diff

... ... @@ -46,7 +46,7 @@
46 46 static long ratelimit_pages = 32;
47 47  
48 48 static long total_pages; /* The total number of pages in the machine. */
49   -static int dirty_exceeded; /* Dirty mem may be over limit */
  49 +static int dirty_exceeded __cacheline_aligned_in_smp; /* Dirty mem may be over limit */
50 50  
51 51 /*
52 52 * When balance_dirty_pages decides that the caller needs to perform some
... ... @@ -212,7 +212,8 @@
212 212 if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
213 213 break;
214 214  
215   - dirty_exceeded = 1;
  215 + if (!dirty_exceeded)
  216 + dirty_exceeded = 1;
216 217  
217 218 /* Note: nr_reclaimable denotes nr_dirty + nr_unstable.
218 219 * Unstable writes are a feature of certain networked
... ... @@ -234,7 +235,7 @@
234 235 blk_congestion_wait(WRITE, HZ/10);
235 236 }
236 237  
237   - if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
  238 + if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh && dirty_exceeded)
238 239 dirty_exceeded = 0;
239 240  
240 241 if (writeback_in_progress(bdi))