From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31023C4727E for ; Wed, 30 Sep 2020 11:37:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6B22A20738 for ; Wed, 30 Sep 2020 11:37:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B22A20738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 994AD6B0068; Wed, 30 Sep 2020 07:37:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 945B66B006C; Wed, 30 Sep 2020 07:37:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8344B6B006E; Wed, 30 Sep 2020 07:37:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 6DB816B0068 for ; Wed, 30 Sep 2020 07:37:09 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 353428249980 for ; Wed, 30 Sep 2020 11:37:09 +0000 (UTC) X-FDA: 77319526578.24.field15_040dcad27192 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 1A3FD1A4A0 for ; Wed, 30 Sep 2020 11:37:09 +0000 (UTC) X-HE-Tag: field15_040dcad27192 X-Filterd-Recvd-Size: 2639 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Sep 2020 11:37:08 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 51CC6ABC1; Wed, 30 Sep 2020 11:37:07 +0000 (UTC) Subject: Re: [PATCH 1/1] mm, slub: Restore initial kmem_cache flags To: Eric Farman Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Kees Cook , linux-mm@kvack.org References: <20200930112612.76109-1-farman@linux.ibm.com> <20200930112612.76109-2-farman@linux.ibm.com> From: Vlastimil Babka Message-ID: Date: Wed, 30 Sep 2020 13:37:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200930112612.76109-2-farman@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/30/20 1:26 PM, Eric Farman wrote: > The routine that applies debug flags to the kmem_cache slabs > inadvertantly prevents non-debug flags from being applied to > those same objects. That is, if slub_debug=, is > specified, non-debugged slabs will end up having flags of zero, > and the slabs will be unusable. Fix this by returning the input > flags for non-matching slabs as was done previously. Thanks a lot for debugging this and sorry for the trouble! > Fixes: e17f1dfba37b ("mm, slub: extend slub_debug syntax for multiple blocks") > Signed-off-by: Eric Farman Acked-by: Vlastimil Babka But with a small adjustment below: > --- > mm/slub.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/slub.c b/mm/slub.c > index d4177aecedf6..3d7c95fd6a08 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1450,7 +1450,7 @@ slab_flags_t kmem_cache_flags(unsigned int object_size, > } > } > > - return slub_debug; > + return flags; To keep supporting the case of "debug flags set for all caches, with exceptions for listed caches", i.e. "slub_debug=FZ;-,zs_handle,zspage", we should return here this: return flags | slub_debug; Thanks again! > } > #else /* !CONFIG_SLUB_DEBUG */ > static inline void setup_object_debug(struct kmem_cache *s, >