From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758233AbcKCUd2 (ORCPT ); Thu, 3 Nov 2016 16:33:28 -0400 Received: from resqmta-ch2-02v.sys.comcast.net ([69.252.207.34]:34689 "EHLO resqmta-ch2-02v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbcKCUd1 (ORCPT ); Thu, 3 Nov 2016 16:33:27 -0400 Date: Thu, 3 Nov 2016 15:33:27 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: David Rientjes cc: Thomas Garnier , Pekka Enberg , Joonsoo Kim , Andrew Morton , Linux-MM , LKML , Greg Thelen , Vladimir Davydov , Michal Hocko Subject: Re: [PATCH v2] memcg: Prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB In-Reply-To: Message-ID: References: <1477939010-111710-1-git-send-email-thgarnie@google.com> Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfDX4+HO1KF0ASExITO7iyMZ9KwO3ipNrUNteqPrQFvvSda9lqlVdHWXcr5k4LRkGFSM2O7ret5gRC+Q58PNsfBVse1hhoB5vDGr12mS/5ffD4AQ3w1hx liHtEF7/Qqbl7/IdfRN+7W7p3Q6yNheW2SLbyk0kYjdoJ36e+WiOSAS3ceqikfeHgwhAxKCqiwc1nCuq0JRDfcchZzCljWRoypoG2W6eQuUKnXU0ZeOYuEy6 UDNbVBWNkMXyJULF/IAVEUkfyxOAQeHHs2J0lrBXsTh3J/XjOnR/iRv0BWAlA/XVL+EJNRTBBlAUY+o0iqXW/deYq4DqoZLP1oTP9VBSYIEUodnwnZ8bDSAx /rUTz1TUQg+vE9KIJCGoY4DiTxD/xyfPny6gWHz42WUcDbmB3dyh5+us5UjHJIhQf/5QUWCM9gHJSJfg+ZGhNbFeEROVxJ79nzfD3ogUVaeYE65DrpI= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Nov 2016, David Rientjes wrote: > > Christoph on the first version advised removing invalid flags on the > > caller and checking they are correct in kmem_cache_create. The memcg > > path putting the wrong flags is through create_cache but I still used > > this approach. > > > > I think this is a rather trivial point since it doesn't matter if we clear > invalid flags on the caller or in the callee and obviously > kmem_cache_create() does it in the callee. In order to be correct we need to do the following: kmem_cache_create should check for invalid flags (and that includes internal alloocator flgs) being set and refuse to create the slab cache. memcg needs to call kmem_cache_create without any internal flags. I also want to make sure that there are no other callers that specify extraneou flags while we are at it. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f197.google.com (mail-yw0-f197.google.com [209.85.161.197]) by kanga.kvack.org (Postfix) with ESMTP id 40AAB6B02D8 for ; Thu, 3 Nov 2016 16:33:27 -0400 (EDT) Received: by mail-yw0-f197.google.com with SMTP id t125so127336304ywc.4 for ; Thu, 03 Nov 2016 13:33:27 -0700 (PDT) Received: from resqmta-ch2-04v.sys.comcast.net (resqmta-ch2-04v.sys.comcast.net. [2001:558:fe21:29:69:252:207:36]) by mx.google.com with ESMTPS id l195si3156675ioe.182.2016.11.03.13.33.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Nov 2016 13:33:26 -0700 (PDT) Date: Thu, 3 Nov 2016 15:33:27 -0500 (CDT) From: Christoph Lameter Subject: Re: [PATCH v2] memcg: Prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB In-Reply-To: Message-ID: References: <1477939010-111710-1-git-send-email-thgarnie@google.com> Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Thomas Garnier , Pekka Enberg , Joonsoo Kim , Andrew Morton , Linux-MM , LKML , Greg Thelen , Vladimir Davydov , Michal Hocko On Wed, 2 Nov 2016, David Rientjes wrote: > > Christoph on the first version advised removing invalid flags on the > > caller and checking they are correct in kmem_cache_create. The memcg > > path putting the wrong flags is through create_cache but I still used > > this approach. > > > > I think this is a rather trivial point since it doesn't matter if we clear > invalid flags on the caller or in the callee and obviously > kmem_cache_create() does it in the callee. In order to be correct we need to do the following: kmem_cache_create should check for invalid flags (and that includes internal alloocator flgs) being set and refuse to create the slab cache. memcg needs to call kmem_cache_create without any internal flags. I also want to make sure that there are no other callers that specify extraneou flags while we are at 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