Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp875043rwd; Thu, 25 May 2023 05:21:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6PBl+sEivvWqFgPjv9fNIHPgXuRUiKaa4SC3xnz3W35rODbQA70CoII8KwwJWNuamMT5m/ X-Received: by 2002:a05:6a20:748e:b0:10c:b9ed:6a3f with SMTP id p14-20020a056a20748e00b0010cb9ed6a3fmr2761899pzd.7.1685017293134; Thu, 25 May 2023 05:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685017293; cv=none; d=google.com; s=arc-20160816; b=Kf3XeMhvTvzm3QNUG95CJXyTh4DGpAsFn3NYmYN8Kx4EdeMo4YZQtCyRqXs3fX/Yb8 3VGyBfF5xz8LaAUP20dRSMzzuwGrLoyl8tSPzAwt0ZqIFvFhK6ZngzZumlo1ct/Nn7fW +Zj8EYiixF7VoE3hzgt/nAiFNi3pLp6nfmH/Iw3+eo/xRyE9YPOuLd9jGxNxhxsimnTz j/hg4QL8mJv6MEbQqCbNhPFeeIJy6yJt90ByJzsOHAiI2rk+q/y6wmF2+2JOVgWLVEKr bg3+cCC6kfjVRsiIqKMNb45vkZfMwjMpxgUMZoNnk3/KZ4Q+xaeMmmZTDEki/pJRQajL CZ0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=rQIsiO41ktVyMsAWXNNe4e1XrL665FizATFtQHtOJdc=; b=ks6Cux4Z/3YjB+tN3UndMN4AvozAwEqyhxJdeHIJQmvi0yRd9yoWGHf56UcNp7VlYI 4NFk9Md99f26/W7BdZkHgCIZ99DukasYW/aYhqFryU5vF2mQhe9UGIgLLHzKbcrrLNLk ripcbtUfoE8qsDqo5gNxMU8CpjQ/iaDE96I/+oTitSrtpf4uPfVVIIPkvRLlpMwo975f 57xHSDzR2lm1rF7Qk6WtD5AdDumLVG4iFjRJhgwWCB5M7JyWCPXdcoh699IXroD487Aw MWht0GTiwg0ZCCtr1ms58fsghA/AcH8ddM3F6AE5lBqNP0d5hjiqaLt568mgwyWvVYGO 9uNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dRB9JNpO; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 192-20020a6302c9000000b0053439a3ba31si983314pgc.711.2023.05.25.05.21.20; Thu, 25 May 2023 05:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dRB9JNpO; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241110AbjEYMFc (ORCPT + 99 others); Thu, 25 May 2023 08:05:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233511AbjEYMFa (ORCPT ); Thu, 25 May 2023 08:05:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6CC59C for ; Thu, 25 May 2023 05:05:29 -0700 (PDT) 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-out1.suse.de (Postfix) with ESMTPS id 77FDC21D66; Thu, 25 May 2023 12:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1685016328; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rQIsiO41ktVyMsAWXNNe4e1XrL665FizATFtQHtOJdc=; b=dRB9JNpO0QbErDqsnjHZFexCFNall3fmqU7Rk3HMSJKFuhJvvBQ2ly0kl3yfQy8ynhpKY2 lStR3+td8byQw+0w3E0VRPpKDI8q7bUPA0yy+RXXCYuEI/aIPDJ5GJmYSwnReSPttsargg /MQuXkevSNbVD3WmhIEGI+K15+33TEk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1685016328; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rQIsiO41ktVyMsAWXNNe4e1XrL665FizATFtQHtOJdc=; b=F43u4XwNzZZHr7IcO1SXQM7xcoPb5aJ5D+cxxIbSXAKPeIxzWu+IJGhn0ls26nVIQL92g5 yOLEmKBokva8p2CQ== 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 3DA60134B2; Thu, 25 May 2023 12:05:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jK1RDghPb2TwKgAAMHmgww (envelope-from ); Thu, 25 May 2023 12:05:28 +0000 Date: Thu, 25 May 2023 13:59:20 +0200 From: David Sterba To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: David Sterba , Christoph Lameter , David Rientjes , Pekka Enberg , Vlastimil Babka , Andrew Morton , Joonsoo Kim , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Roman Gushchin Subject: Re: [PATCH] mm/slab: add new flag SLAB_NO_MERGE to avoid merging per slab Message-ID: <20230525115920.GG30909@suse.cz> Reply-To: dsterba@suse.cz References: <20230524101748.30714-1-dsterba@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 24, 2023 at 09:56:02PM +0900, Hyeonggon Yoo wrote: > On Wed, May 24, 2023 at 12:17:48PM +0200, David Sterba wrote: > > Add a flag that allows to disable merging per slab. This can be used for > > more fine grained control over the caches or for debugging builds where > > separate slabs can verify that no objects leak. > > The slab_nomerge boot option is too coarse and would need to be enabled > > on all testing hosts. > > There is no users nor interface to set this flag, I guess you're going > to use it by modifying source code, when debugging? An example usage --- a/fs/btrfs/fs.h +++ b/fs/btrfs/fs.h @@ -12,6 +12,12 @@ #include "async-thread.h" #include "block-rsv.h" +#ifdef CONFIG_BTRFS_DEBUG +#define SLAB_DEBUG_NO_MERGE 0 +#else +#define SLAB_DEBUG_NO_MERGE SLAB_NO_MERGE +#endif + #define BTRFS_MAX_EXTENT_SIZE SZ_128M #define BTRFS_OLDEST_GENERATION 0ULL --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -5049,7 +5049,7 @@ int __init btrfs_ctree_init(void) { btrfs_path_cachep = kmem_cache_create("btrfs_path", sizeof(struct btrfs_path), 0, - SLAB_MEM_SPREAD, NULL); + SLAB_MEM_SPREAD | SLAB_DEBUG_NO_MERGE, NULL); if (!btrfs_path_cachep) return -ENOMEM; return 0; --- and this will be a permanent change, not added as needed. > Does introducing new slub_debug option (i.e. slub_debug=N,pid_namespace) > work for your use case? (there are some boot-time slub_debug options described in > Documentation/mm/slub.rst) I'd like to keep boot parameters unchanged, the testing setups are different, physical, local VM, hosted. For the same reason the config option CONFIG_SLUB_DEBUG_ON=y is very convenient.