Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3909655pxv; Mon, 26 Jul 2021 15:33:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4+RdsV6JdhZFfUCFXlUQBJvzrhTg2+bV85RxeMJCQiLgUTweVjbCWqVDPpJ/Lgmhq3l0r X-Received: by 2002:a05:6e02:dc4:: with SMTP id l4mr15101645ilj.94.1627338832236; Mon, 26 Jul 2021 15:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627338832; cv=none; d=google.com; s=arc-20160816; b=IlEnamTNg9BqiOCconYdSpXq5iYLbNQg9p4SWEkhnVo7i2MWtdk3EwFHohC6gBsP0W ulXselQxCLj97ln/N+9UPttxdCotUD4AElHVoLryM9bscEEeVENp8Bgj3i2Rc31kCMh/ OH5y0l7xvD8gnoHdDAZloTPE0PrL3uTx4RWBEA/Z1Y0kjod3XuV+K+6YYxKm2cJCBVY6 CU9UFWIkgeEDP6t+ASXjRc/z/O3/S/fj2KV2QUrhzIS4FVkufA6G1l5qcScoK7IBf/iw 1DjHwJpmi3Wtq6QdUNLxge5q7rAoEuYaDxH6N3szL7f7iQpBFJ1/BDpflkd7fFzfgCiQ 6Mkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=Dwp+6cUgmzSiItnZGSf7ON9rwGenCLOs8nq3oQB4Rn0=; b=IfKNA238tNFzIsxxsXhSv+cMtjuyBQc/bMaLafWleqWC8NLrC83JExsxMPmij4H3C5 LDKbGse764pJdw1eqEhJRrNAkkmN6wMw/5+9OJpXyYiTzmzy+oqTQZan6jkF4sILgMRR ZL4R+ryJ3YgHfVZFR2X7d2LKbPRQ9aPskC7iTYoog3Z/xjCAhx/1qjxLKU9+nCCSRYjH Fhboauvui0JMkKkGnsFu46TiAxHPZV65V6GiEDfF5gkuaMLuHQxeQmBFyOYWQz9hZvrt +pLeWQCekX9PNp84S7BAUgxXA7UBJKBr/fsVKXDoGqh0rNER9QZ49qdib28fki7bb5Hx Topw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="mtQd5CD/"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="/WE7TMjz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w21si1104016jah.86.2021.07.26.15.33.38; Mon, 26 Jul 2021 15:33:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="mtQd5CD/"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="/WE7TMjz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233660AbhGZVwR (ORCPT + 99 others); Mon, 26 Jul 2021 17:52:17 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:46900 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232876AbhGZVwQ (ORCPT ); Mon, 26 Jul 2021 17:52:16 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BE1AF1FD3D; Mon, 26 Jul 2021 22:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1627338763; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dwp+6cUgmzSiItnZGSf7ON9rwGenCLOs8nq3oQB4Rn0=; b=mtQd5CD//NEpLWYAuXKxPTwVN2YAuXWoH2ppFF+5SB/Ehm2lix3fGf69BDlBdx5BHTk4eX SaoQxRPq8rrZr9YlbBLvpEnxDr8bHYpo1OnKUEk8jfrO/oGpOavAowNJVXtZkTaZS6aIHP L7Y58wsUFlSHCpjvy4iWhAV2q4MZjhQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1627338763; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dwp+6cUgmzSiItnZGSf7ON9rwGenCLOs8nq3oQB4Rn0=; b=/WE7TMjzI1Iau2rh9Qig5htwOnCNIL/np0AQHtHFTU27Dq3zCb9JVx0PTkmBAPX/5t/x/H 9d9L6+55PHx5OFAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 76B1713B58; Mon, 26 Jul 2021 22:32:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jVlfGws4/2BCTgAAMHmgww (envelope-from ); Mon, 26 Jul 2021 22:32:43 +0000 Subject: Re: [PATCH] mm: slub: Fix slub_debug disablement for list of slabs To: vjitta@codeaurora.org, 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: Vlastimil Babka Message-ID: Date: Tue, 27 Jul 2021 00:32:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1626176750-13099-1-git-send-email-vjitta@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? ----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 -- 2.32.0