[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0811241702040.1550@chino.kir.corp.google.com>
Date: Mon, 24 Nov 2008 17:05:03 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Randy Dunlap <randy.dunlap@...cle.com>
cc: Andrew Morton <akpm@...ux-foundation.org>, peterz@...radead.org,
david@...morbit.com, cl@...ux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [patch 2/2] mm: add dirty_background_bytes and dirty_bytes
sysctls
On Mon, 24 Nov 2008, Randy Dunlap wrote:
> >> - if (background_ratio >= dirty_ratio)
> >> - background_ratio = dirty_ratio / 2;
> >> + dirty_ratio = vm_dirty_ratio;
> >> + if (dirty_ratio < 5)
> >> + dirty_ratio = 5;
> >> + dirty = (dirty_ratio * available_memory) / 100;
> >> + }
> >> +
> >> + if (dirty_background_bytes)
> >> + background = (dirty_background_bytes + PAGE_SIZE) / PAGE_SIZE;
> >
> > DIV_ROUND_UP()?
>
> Note that DIV_ROUND_UP() would make that
>
> background = (dirty_background_byte + PAGE_SIZE - 1) / PAGE_SIZE;
>
> but that's usually what is needed/intended.
>
Good point. If we were to do this, then dirty_bytes and
dirty_background_bytes should use 1 instead of 0 as the minimum acceptable
value in proc_dointvec_minmax(). Otherwise, get_dirty_limits() would
return 0 pages for the dirty limit when 0 is written to either file since
integer division truncates and we'd be in a constant state of writeback :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists