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-next>] [day] [month] [year] [list]
Message-ID: <56154bf4-c1e2-16d5-c6e2-c2dee42d3377@quicinc.com>
Date: Tue, 23 Jan 2024 16:33:51 +0530
From: Charan Teja Kalla <quic_charante@...cinc.com>
To: <Liam.Howlett@...cle.com>, Matthew Wilcox <willy@...radead.org>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
        LKML
	<linux-kernel@...r.kernel.org>
Subject: Purpose of maple_node objects to be its size aligned

I am just curious about the purpose of maple node slab objects to be its
size aligned, but I can understand why they need to be cache aligned.

void __init maple_tree_init(void)
{
	maple_node_cache = kmem_cache_create("maple_node",
			sizeof(struct maple_node),
			sizeof(struct maple_node),// Alignment of the slab object.
			SLAB_PANIC, NULL);
}

Reason for the ask is, when slub debug enabled with option Z, the change
[1] makes the total object to be 256 * 3 (=768)bytes.  This turns out to
be a problem in debug builds where the unreclaimable slab consumption
itself is very high thus exerting the memory pressure on the system.

maple_node:
  orginal object size 	   = 256b
  after slub_debug enabled = 768b


If, there is no special requirement, other than just needs to be cache
aligned, thinking of the below:

--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6283,8 +6283,8 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp)
 void __init maple_tree_init(void)
 {
        maple_node_cache = kmem_cache_create("maple_node",
-                       sizeof(struct maple_node), sizeof(struct
maple_node),
-                       SLAB_PANIC, NULL);
+                       sizeof(struct maple_node), 0,
+                       SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
 }


[1]d86bd1bece6f ("mm/slub: support left redzone")

Thanks,
charan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ