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=-15.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,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 4E14DC4338F for ; Tue, 27 Jul 2021 04:43:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7069F6108C for ; Tue, 27 Jul 2021 04:43:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7069F6108C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B6C206B0036; Tue, 27 Jul 2021 00:43:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF7296B005D; Tue, 27 Jul 2021 00:43:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E3FA8D0001; Tue, 27 Jul 2021 00:43:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 81E0F6B0036 for ; Tue, 27 Jul 2021 00:43:39 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 323BA18035425 for ; Tue, 27 Jul 2021 04:43:39 +0000 (UTC) X-FDA: 78407124558.32.964A9B9 Received: from m43-7.mailgun.net (m43-7.mailgun.net [69.72.43.7]) by imf24.hostedemail.com (Postfix) with ESMTP id 18901B001BF0 for ; Tue, 27 Jul 2021 04:43:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1627361018; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=l0LBbkn2wIgdM60dnKzVULyBKqRCDMcLHAj1YaazBvI=; b=ilqdXCOV/D7cG4lW6Lc+99bb5wz6zppyBxVV/D8IiP3ouJ8u6SUZFWqd7JZpJLAAT4fKJt14 pOagYOG1fkawMTp/M+8uGiIVj9bpjbjRp5R1wAvbskad/B8gawYqeGa/ydIbvv/nqxzsO3zW HO9ruPqKHgYFh80Y5qEGDA0xsyo= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 60ff8ef496a66e66b2b8862a (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 27 Jul 2021 04:43:32 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 84B5DC43217; Tue, 27 Jul 2021 04:43:32 +0000 (UTC) Received: from [192.168.0.102] (unknown [14.192.2.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vjitta) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6CA9DC4323A; Tue, 27 Jul 2021 04:43:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6CA9DC4323A Subject: Re: [PATCH] mm: slub: Fix slub_debug disablement for list of slabs To: Vlastimil Babka , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, vinmenon@codeaurora.org References: <1626176750-13099-1-git-send-email-vjitta@codeaurora.org> From: Vijayanand Jitta Message-ID: Date: Tue, 27 Jul 2021 10:13:16 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=mg.codeaurora.org header.s=smtp header.b=ilqdXCOV; spf=pass (imf24.hostedemail.com: domain of bounce@mg.codeaurora.org designates 69.72.43.7 as permitted sender) smtp.mailfrom=bounce@mg.codeaurora.org; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 18901B001BF0 X-Stat-Signature: wapkekmmsezedn4fwun4tztft68nqu11 X-HE-Tag: 1627361016-334552 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 7/27/2021 4:02 AM, Vlastimil Babka wrote: > On 7/13/21 1:45 PM, vjitta@codeaurora.org wrote: >> From: Vijayanand Jitta >> >> Consider the scenario where CONFIG_SLUB_DEBUG_ON is set >> and we would want to disable slub_debug for few slabs. >> Using boot parameter with slub_debug=-,slab_name syntax >> doesn't work as expected i.e; only disabling debugging for >> the specified list of slabs, instead it disables debugging >> for all slabs. Fix this. >> >> Signed-off-by: Vijayanand Jitta > > Would the following work too, and perhaps be easier to follow? Right, the below change would also work and its easier to follow as you said. We can go with this. Reviewed-by: Vijayanand Jitta Thanks, Vijay > ----8<---- > diff --git a/mm/slub.c b/mm/slub.c > index 090fa14628f9..024f49706386 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1400,12 +1400,13 @@ parse_slub_debug_flags(char *str, slab_flags_t *flags, char **slabs, bool init) > static int __init setup_slub_debug(char *str) > { > slab_flags_t flags; > + slab_flags_t global_flags; > char *saved_str; > char *slab_list; > bool global_slub_debug_changed = false; > bool slab_list_specified = false; > > - slub_debug = DEBUG_DEFAULT_FLAGS; > + global_flags = DEBUG_DEFAULT_FLAGS; > if (*str++ != '=' || !*str) > /* > * No options specified. Switch on full debugging. > @@ -1417,7 +1418,7 @@ static int __init setup_slub_debug(char *str) > str = parse_slub_debug_flags(str, &flags, &slab_list, true); > > if (!slab_list) { > - slub_debug = flags; > + global_flags = flags; > global_slub_debug_changed = true; > } else { > slab_list_specified = true; > @@ -1426,16 +1427,18 @@ static int __init setup_slub_debug(char *str) > > /* > * For backwards compatibility, a single list of flags with list of > - * slabs means debugging is only enabled for those slabs, so the global > - * slub_debug should be 0. We can extended that to multiple lists as > + * slabs means debugging is only changed for those slabs, so the global > + * slub_debug should be unchanged (0 or DEBUG_DEFAULT_FLAGS, depending > + * on CONFIG_SLUB_DEBUG_ON). We can extended that to multiple lists as > * long as there is no option specifying flags without a slab list. > */ > if (slab_list_specified) { > if (!global_slub_debug_changed) > - slub_debug = 0; > + global_flags = slub_debug; > slub_debug_string = saved_str; > } > out: > + slub_debug = global_flags; > if (slub_debug != 0 || slub_debug_string) > static_branch_enable(&slub_debug_enabled); > else > -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation