[sheepdog] [PATCH v2] object cache: introduce background pusher

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jun 11 07:40:47 CEST 2013


At Sat,  8 Jun 2013 19:45:38 +0800,
Liu Yuan wrote:
> 
> Background pusher will mitigate the following problems
> 1 take a long time to flush a largely accumulated dirty objects set
> 2 some old kernel might not issue flush request periodically and get a long
>   wait while shutdown the VM
> 
> We kick background pusher when there are more than MAX_DIRTY_OBJECT_COUNT dirty
> object. At anytime, we only allow one pusher running, be it background pusher or
> synchronous pusher triggered by VM flush request.
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  v2
>  - don't kick pusher at startup if we have loaded dirty objects
> 
>  sheep/object_cache.c |   86 ++++++++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 76 insertions(+), 10 deletions(-)
> 
> diff --git a/sheep/object_cache.c b/sheep/object_cache.c
> index 18f1198..b227ebe 100644
> --- a/sheep/object_cache.c
> +++ b/sheep/object_cache.c
> @@ -48,6 +48,9 @@
>  
>  #define CACHE_OBJECT_SIZE (SD_DATA_OBJ_SIZE / 1024 / 1024) /* M */
>  
> +/* Kick background pusher if dirty_count greater than it */
> +#define MAX_DIRTY_OBJECT_COUNT	10
> +

Please describe the rationale for the number.

Other parts look good to me.

Thanks,

Kazutaka



More information about the sheepdog mailing list