Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756814Ab2F0TqN (ORCPT ); Wed, 27 Jun 2012 15:46:13 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:56275 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753225Ab2F0TqL (ORCPT ); Wed, 27 Jun 2012 15:46:11 -0400 Date: Wed, 27 Jun 2012 12:46:08 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Glauber Costa cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, Frederic Weisbecker , Pekka Enberg , Michal Hocko , Johannes Weiner , Christoph Lameter , devel@openvz.org, KAMEZAWA Hiroyuki , Tejun Heo , Pekka Enberg Subject: Re: [PATCH 06/11] memcg: kmem controller infrastructure In-Reply-To: <4FEAD351.2030203@parallels.com> Message-ID: References: <1340633728-12785-1-git-send-email-glommer@parallels.com> <1340633728-12785-7-git-send-email-glommer@parallels.com> <4FE97E31.3010201@parallels.com> <4FEAD351.2030203@parallels.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 949 Lines: 22 On Wed, 27 Jun 2012, Glauber Costa wrote: > > > Nothing, but I also don't see how to prevent that. > > > > You can test for current->flags & PF_KTHREAD following the check for > > in_interrupt() and return true, it's what you were trying to do with the > > check for !current->mm. > > > > am I right to believe that if not in interrupt context - already ruled out - > and !(current->flags & PF_KTHREAD), I am guaranteed to have a mm context, and > thus, don't need to test against it ? > No, because an mm may have been detached in the exit path by running exit_mm(). We'd certainly hope that there are no slab allocations following that point, though, but you'd still need to test current->mm. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/