Re: [patch 4/8] mm: memcg: push !mm handling out to page cache charge function

From: Michal Hocko
Date: Wed Mar 12 2014 - 09:12:06 EST


On Tue 11-03-14 21:28:30, Johannes Weiner wrote:
[...]
> @@ -4070,6 +4061,12 @@ int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
> return 0;
>
> if (!PageSwapCache(page)) {
> + /*
> + * Page cache insertions can happen without an actual
> + * task context, e.g. during disk probing on boot.

We read a page cache during disk probing? I have tried to find such a
code path but failed. Could you point me to such a path, please?
I thought that such probing is done from udev context but I am not
familiar with this area TBH.

Thanks!

> + */
> + if (!mm)
> + memcg = root_mem_cgroup;
> ret = __mem_cgroup_try_charge(mm, gfp_mask, 1, &memcg, true);
> if (ret != -ENOMEM)
> __mem_cgroup_commit_charge(memcg, page, 1, type, false);
> --
> 1.9.0
>

--
Michal Hocko
SUSE Labs
--
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/