Messages in this thread | | | Date | Fri, 4 Sep 2009 14:06:12 +0200 | From | Jens Axboe <> | Subject | Re: [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
| |