On Thu, 1 Nov 2012 16:07:36 +0400
Glauber Costa <[email protected]> wrote:
> This patch creates a mechanism that skip memcg allocations during
> certain pieces of our core code. It basically works in the same way
> as preempt_disable()/preempt_enable(): By marking a region under
> which all allocations will be accounted to the root memcg.
>
> We need this to prevent races in early cache creation, when we
> allocate data using caches that are not necessarily created already.
>
> ...
>
> +static inline void memcg_stop_kmem_account(void)
> +{
> + if (!current->mm)
> + return;
It is utterly unobvious to this reader why the code tests ->mm in this
fashion. So we need either smarter readers or a code comment.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/