[Devel] [PATCH v2 rh7 1/2] fs/writeback: per-CT fs writeback
Vladimir Davydov
vdavydov at virtuozzo.com
Wed Jan 20 07:51:43 PST 2016
On Tue, Jan 19, 2016 at 07:14:29PM +0300, Andrey Ryabinin wrote:
...
> @@ -1004,6 +1022,8 @@ static long wb_check_background_flush(struct bdi_writeback *wb)
> .for_background = 1,
> .range_cyclic = 1,
> .reason = WB_REASON_BACKGROUND,
> + .filter_ub = 0,
> + .ub = NULL,
Please don't initialize struct fields to 0 - this is done automatically.
It increases churn and complicates rebases.
> };
>
> return wb_writeback(wb, &work);
> @@ -1038,6 +1058,8 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb)
...
> @@ -157,8 +193,10 @@ bool ub_should_skip_writeback(struct user_beancounter *ub, struct inode *inode)
>
> rcu_read_lock();
> dirtied_ub = rcu_dereference(inode->i_mapping->dirtied_ub);
> - ret = !dirtied_ub || (dirtied_ub != ub &&
> - !test_bit(UB_DIRTY_EXCEEDED, &dirtied_ub->ub_flags));
> + if (ub)
> + ret = (ub != dirtied_ub);
> + else
> + ret = (dirtied_ub && !ub_over_bground_thresh());
No need to check all beancounters here.
__ub_over_bground_thresh(dirtied_ub) should be enough.
> rcu_read_unlock();
>
> return ret;
More information about the Devel
mailing list