From mboxrd@z Thu Jan 1 00:00:00 1970 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 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Rientjes Subject: Re: [PATCH 06/11] memcg: kmem controller infrastructure Date: Wed, 27 Jun 2012 12:46:08 -0700 (PDT) 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> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=yo893/iIUFbjfpQwc0RjQbg9OEC1/cj9gNBjG/tusWE=; b=A7DdW5aGrSEeCRZAf9LEjM5oi6LDSBkJ8lmsfolH3je0CqRqYM0Q4wamBWORI7cNBj gTTHUoyjME1PqLj38gHBe/tPxwQYMeryGbANBGPIdxwHmsV+35Jwv335eG84Kzu6OwOA VMeU+Y7RD8L557PMVFSuV1pwIQfoBMW93kVFLTh/+ogIF7GxWRgKklJaCrNS6MpkiGhV 8nijtEr+3wGOFVpg6Rm25TWIBAz4DVARjeXoRAzmu440szMc2txqhC9+8tWqf+VoeJ6y Gsumpry9o6l+uwiej2MUXQn4fjWDr96l5e9Kry2CqUHsFwa94fo8iaWFhhF2iTsZlIpQ ZbKA== In-Reply-To: <4FEAD351.2030203@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: Content-Type: TEXT/PLAIN; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org