Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751579AbcKGT2L (ORCPT ); Mon, 7 Nov 2016 14:28:11 -0500 Received: from resqmta-ch2-05v.sys.comcast.net ([69.252.207.37]:33473 "EHLO resqmta-ch2-05v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbcKGT2J (ORCPT ); Mon, 7 Nov 2016 14:28:09 -0500 Date: Mon, 7 Nov 2016 13:28:09 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Thomas Garnier cc: David Rientjes , 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: MS4wfBngHTrbbZvlyRXtl9ItM/rNU4cqo7D0fYppBq22/l7xed99MOave4P/HUMZHerH05OMxk5hNCpzL8EpraHjrv8q72EqVXH14RTi5IEhtkwpdr2VMOHL zvbrYZYEWOXMc21itBcGRpjHesMTTmSL9XxQm6aMpwRBShAyWZNauheqDeXU+k4FFFnDBZkIStL+XsgB5DVFG7TzpnA7qXFWmnVa28KG/RGKluhSO6FqNZJY pj9FGooa+6a7kfBzxJjq1EN/H3n7REqxHOFpqpFd8HUGXi1CCOvrlovkjEkFNVg7Ozr1GrTA6FRucXBiZiGPywcgN7tcR9IQ8KRzTB1Kpbc3vKresWfjcslh 0mx1Cq7PbgKiwCaMzZk9EPdDFTRtCxdQlS9/tFvwWase3ghCmZxBbt2extV0hM7HWaMdGuEIAokLs1Xjv1T52Es8WeDMUWlmHHHzkiJWHDnfwdTcAfM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 931 Lines: 25 On Mon, 7 Nov 2016, Thomas Garnier wrote: > I am not sure that is possible. kmem_cache_create currently check for > possible alias, I assume that it goes against what memcg tries to do. What does aliasing have to do with this? The aliases must have the same flags otherwise the caches would not have been merged. > Separate the changes in two patches might make sense: > > 1) Fix the original bug by masking the flags passed to create_cache > 2) Add flags check in kmem_cache_create. > > Does it make sense? Sure. > > I also want to make sure that there are no other callers that specify > > extraneou flags while we are at it. > I will review as many as I can but we might run into surprises (quick > boot on defconfig didn't show anything). That's why having two > different patches might be useful. These surprises can be caught later ... Just make sure that the core works fine with this. You cannot audit all drivers.