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 EF89DC4727E for ; Wed, 30 Sep 2020 13:54:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 341E020759 for ; Wed, 30 Sep 2020 13:54:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 341E020759 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 60D036B0062; Wed, 30 Sep 2020 09:54:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 595BB6B0068; Wed, 30 Sep 2020 09:54:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45DDD6B006C; Wed, 30 Sep 2020 09:54:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 2B8836B0062 for ; Wed, 30 Sep 2020 09:54:18 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DAF33181AE864 for ; Wed, 30 Sep 2020 13:54:17 +0000 (UTC) X-FDA: 77319872154.26.cry46_3a0dd1d27193 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id BA73B1804B647 for ; Wed, 30 Sep 2020 13:54:17 +0000 (UTC) X-HE-Tag: cry46_3a0dd1d27193 X-Filterd-Recvd-Size: 3113 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Sep 2020 13:54:17 +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 CA91DAC9A; Wed, 30 Sep 2020 13:54:15 +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> <28af00ac-def7-e5d8-2d31-f477f47222e3@linux.ibm.com> From: Vlastimil Babka Message-ID: Date: Wed, 30 Sep 2020 15:54:14 +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: <28af00ac-def7-e5d8-2d31-f477f47222e3@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 3:06 PM, Eric Farman wrote: > > > On 9/30/20 7:37 AM, Vlastimil Babka wrote: >> 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! > > You're welcome. Just glad I wasn't losing my mind! > >> >>> 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; > > Ah, cool... I wondered about that, but didn't go far enough down the > combinations. Does it then make sense to strip out the "if > (!slub_debug_string)" check at the beginning of the function? As in: Yeah, that makes sense. Thanks!