Re: [PATCH v5 9/9] memcg: check memcg dirty limits in page writeback

From: Vivek Goyal
Date: Wed Mar 02 2011 - 18:18:55 EST


On Fri, Feb 25, 2011 at 01:36:00PM -0800, Greg Thelen wrote:

[..]
> @@ -500,18 +527,27 @@ static void balance_dirty_pages(struct address_space *mapping,
> };
>
> global_dirty_info(&sys_info);
> + if (!memcg_dirty_info(NULL, &memcg_info))
> + memcg_info = sys_info;
>
> /*
> * Throttle it only when the background writeback cannot
> * catch-up. This avoids (excessively) small writeouts
> * when the bdi limits are ramping up.
> */
> - if (dirty_info_reclaimable(&sys_info) + sys_info.nr_writeback <=
> + if ((dirty_info_reclaimable(&sys_info) +
> + sys_info.nr_writeback <=
> (sys_info.background_thresh +
> - sys_info.dirty_thresh) / 2)
> + sys_info.dirty_thresh) / 2) &&
> + (dirty_info_reclaimable(&memcg_info) +
> + memcg_info.nr_writeback <=
> + (memcg_info.background_thresh +
> + memcg_info.dirty_thresh) / 2))
> break;
>
> - bdi_thresh = bdi_dirty_limit(bdi, sys_info.dirty_thresh);
> + bdi_thresh = bdi_dirty_limit(bdi,
> + min(sys_info.dirty_thresh,
> + memcg_info.dirty_thresh));
> bdi_thresh = task_dirty_limit(current, bdi_thresh);

Greg, so currently we seem to have per_bdi/per_task dirty limits and
now with this patch it will sort of become per_cgroup/per_bdi/per_task
dirty limits? I think that kind of makes sense to me.

Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/