lkml.org 
[lkml]   [2008]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm] mm: fine-grained dirty_ratio_pcm and dirty_background_ratio_pcm (v2)
On Mon, 10 Nov 2008, Andrea Righi wrote:

> The KB limit is a static value, the other depends on the dirtyable
> memory. If we want to preserve the same behaviour we should do the
> following:
>
> - when dirty_ratio changes to x:
> dirty_amount_in_bytes = x * dirtyable_memory / 100.
>
> - when dirty_amount_in_bytes changes to x:
> dirty_ratio = x / dirtyable_memory * 100
>

I think the idea is for a dynamic dirty_ratio based on a static value
dirty_amount_in_bytes:

dirtyable_memory = determine_dirtyable_memory() * PAGE_SIZE;
dirty_ratio = dirty_amount_in_bytes / dirtyable_memory;

> But anytime the dirtyable memory changes (as well as the total memory in
> the system) we should update both values accordingly to preserve the
> coherency between them.
>

Only dirty_ratio is actually updated if dirty_amount_in_bytes is static.

This allows you to control how many pages are NR_FILE_DIRTY or
NR_UNSTABLE_NFS and gives you the granularity that you want with
dirty_ratio_pcm, but on a byte scale instead of percent.

It's also a clean interface:

echo 200M > /proc/sys/vm/dirty_ratio_bytes


\
 
 \ /
  Last update: 2008-11-10 23:19    [W:1.070 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site