Re: [PATCH] mm: Do not keep page locked during page fault whilecharging it for memcg

From: Christoph Hellwig
Date: Wed Jun 22 2011 - 08:18:03 EST


> +
> + /* We have to drop the page lock here because memcg
> + * charging might block for unbound time if memcg oom
> + * killer is disabled.
> + */
> + unlock_page(vmf.page);
> + ret = mem_cgroup_newpage_charge(page, mm, GFP_KERNEL);
> + lock_page(vmf.page);

This introduces a completely poinless unlock/lock cycle for non-memcg
pagefaults. Please make sure it only happens when actually needed.

--
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/