Re: [PATCH 3/8] writeback: switch to per-bdi threads for flushing data v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux