On Thu, 1 Nov 2012 16:07:36 +0400 Glauber Costa <glommer@xxxxxxxxxxxxx> 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>