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]
Date:   Wed, 14 Sep 2022 00:21:58 +0800
From:   Dawei Li <set_pte_at@...look.com>
To:     sj@...nel.org, akpm@...ux-foundation.org
Cc:     damon@...ts.linux.dev, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Dawei Li <set_pte_at@...look.com>
Subject: [PATCH] mm/damon: Creating kmem cache for damon regions by KMEM_CACHE()

Damon regions are dynamic objects which can be created and destroyed
frequently, a dedicated slab cache is created by KMEM_CACHE(), as
suggested by akpm.

Signed-off-by: Dawei Li <set_pte_at@...look.com>
---
 mm/damon/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 0b1eb945c68a..20163c3c9aa7 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1283,8 +1283,7 @@ bool damon_find_biggest_system_ram(unsigned long *start, unsigned long *end)
 
 static int __init damon_init(void)
 {
-	damon_region_cache = kmem_cache_create("damon_region_cache", sizeof(struct damon_region),
-		0, 0, NULL);
+	damon_region_cache = KMEM_CACHE(damon_region, 0);
 	if (unlikely(!damon_region_cache)) {
 		pr_err("creating damon_region_cache fails\n");
 		return -ENOMEM;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ