From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754731Ab2F0Jf4 (ORCPT ); Wed, 27 Jun 2012 05:35:56 -0400 Received: from mx2.parallels.com ([64.131.90.16]:54554 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753813Ab2F0Jfz (ORCPT ); Wed, 27 Jun 2012 05:35:55 -0400 Message-ID: <4FEAD351.2030203@parallels.com> Date: Wed, 27 Jun 2012 13:33:05 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: David Rientjes CC: , , Andrew Morton , , Frederic Weisbecker , Pekka Enberg , Michal Hocko , Johannes Weiner , Christoph Lameter , , KAMEZAWA Hiroyuki , Tejun Heo , Pekka Enberg Subject: Re: [PATCH 06/11] memcg: kmem controller infrastructure References: <1340633728-12785-1-git-send-email-glommer@parallels.com> <1340633728-12785-7-git-send-email-glommer@parallels.com> <4FE97E31.3010201@parallels.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> >> 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 ? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx152.postini.com [74.125.245.152]) by kanga.kvack.org (Postfix) with SMTP id 235A86B005C for ; Wed, 27 Jun 2012 05:35:54 -0400 (EDT) Message-ID: <4FEAD351.2030203@parallels.com> Date: Wed, 27 Jun 2012 13:33:05 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH 06/11] memcg: kmem controller infrastructure References: <1340633728-12785-1-git-send-email-glommer@parallels.com> <1340633728-12785-7-git-send-email-glommer@parallels.com> <4FE97E31.3010201@parallels.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes 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 >> >> 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 ? -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH 06/11] memcg: kmem controller infrastructure Date: Wed, 27 Jun 2012 13:33:05 +0400 Message-ID: <4FEAD351.2030203@parallels.com> References: <1340633728-12785-1-git-send-email-glommer@parallels.com> <1340633728-12785-7-git-send-email-glommer@parallels.com> <4FE97E31.3010201@parallels.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: David Rientjes Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Andrew Morton , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frederic Weisbecker , Pekka Enberg , Michal Hocko , Johannes Weiner , Christoph Lameter , devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, KAMEZAWA Hiroyuki , Tejun Heo , Pekka Enberg >> >> 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 ?