Re: [PATCH 11/12] mm: per device dirty threshold

Peter Zijlstra
2007-04-19T18:04:14Z

On Thu, 2007-04-19 at 19:49 +0200, Miklos Szeredi wrote:
> > +static inline unsigned long bdi_stat_delta(void)
> > +{
> > +#ifdef CONFIG_SMP
> > + return NR_CPUS * FBC_BATCH;
>
> Shouln't this be multiplied by the number of counters to sum? I.e. 3
> if dirty and unstable are separate, and 2 if they are not.

Ah, yes, good catch. How about this:

---

Since we're adding 3 stat counters, tripple the per counter delta as
well.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
mm/page-writeback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/mm/page-writeback.c
===================================================================
--- linux-2.6.orig/mm/page-writeback.c 2007-04-19 19:59:26.000000000 +0200
+++ linux-2.6/mm/page-writeback.c 2007-04-19 20:00:09.000000000 +0200
@@ -321,7 +321,7 @@ static void balance_dirty_pages(struct a
get_dirty_limits(&background_thresh, &dirty_thresh,
&bdi_thresh, bdi);

- if (bdi_thresh < bdi_stat_delta()) {
+ if (bdi_thresh < 3*bdi_stat_delta()) {
bdi_nr_reclaimable =
bdi_stat_sum(bdi, BDI_DIRTY) +
bdi_stat_sum(bdi, BDI_UNSTABLE);