lkml.org 
[lkml]   [2009]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/8] writeback: switch to per-bdi threads for flushing data v2
On Fri, Sep 04 2009, Jens Axboe wrote:
> +static long wb_check_old_data_flush(struct bdi_writeback *wb)
> +{
> + unsigned long expired;
> + long nr_pages;
> +
> + expired = wb->last_old_flush +
> + msecs_to_jiffies(dirty_writeback_interval * 10);
> + if (time_before(jiffies, expired))
> + return 0;
> +
> + nr_pages = global_page_state(NR_FILE_DIRTY) +
> + global_page_state(NR_UNSTABLE_NFS) +
> + (inodes_stat.nr_inodes - inodes_stat.nr_unused);
> +
> + return wb_writeback(wb, nr_pages, NULL, WB_SYNC_NONE, 1);
> +}

Needs to set ->last_old_flush of course. I also made it check for
nr_pages > 0 before calling into wb_writeback().

--
Jens Axboe



\
 
 \ /
  Last update: 2009-09-04 14:09    [W:0.070 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site