lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230525115920.GG30909@suse.cz>
Date:   Thu, 25 May 2023 13:59:20 +0200
From:   David Sterba <dsterba@...e.cz>
To:     Hyeonggon Yoo <42.hyeyoo@...il.com>
Cc:     David Sterba <dsterba@...e.com>, Christoph Lameter <cl@...ux.com>,
        David Rientjes <rientjes@...gle.com>,
        Pekka Enberg <penberg@...nel.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Roman Gushchin <roman.gushchin@...ux.dev>
Subject: Re: [PATCH] mm/slab: add new flag SLAB_NO_MERGE to avoid merging per
 slab

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ