From patchwork Mon Nov 4 06:16:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Sun X-Patchwork-Id: 13860929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D46FFD11185 for ; Mon, 4 Nov 2024 06:16:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C945C6B007B; Mon, 4 Nov 2024 01:16:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C430B6B0082; Mon, 4 Nov 2024 01:16:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B31D66B0083; Mon, 4 Nov 2024 01:16:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 950C86B007B for ; Mon, 4 Nov 2024 01:16:28 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 09228160448 for ; Mon, 4 Nov 2024 06:16:28 +0000 (UTC) X-FDA: 82747401660.07.CDD7448 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf02.hostedemail.com (Postfix) with ESMTP id 4116580009 for ; Mon, 4 Nov 2024 06:15:26 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf02.hostedemail.com: domain of sk.alvin.x@gmail.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=sk.alvin.x@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730700928; a=rsa-sha256; cv=none; b=m6PQ8c3ttBtf5mTFT6Zd7q2mnYfxrQ6fAJA/qsd8n+T3MbYVzIOQJDqv/Vjj3CFgml8FMB RtpE+NwWXjJ2IP9babyjQrjgkD2cMNX/6cbEUv/kcVxFtfUpo+jSAzRZ6DKYNp98r9ajhr pCxnXQyiSmbSQSZCsWTKFCWciuGTVXU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf02.hostedemail.com: domain of sk.alvin.x@gmail.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=sk.alvin.x@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730700928; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=hw53jXy9qBKwtFSemKjWyJ+vIk9C3EOUGoD/zAntvXg=; b=e6yOtym4jjrNcJKWBSPHcqUDW6pA32s6uymfAS4k/ROZb9GW3oq7eloFaTLtylmDo14Wrx Z3nkpoJ5OjOc8yWZa8pHhjR1wB5aQ1g+qCvIJEeYXlsH5XW8aLTjfNdAxavwek4TLxVbGs TaKoJrvoecJR62yGjm0WDbiH9OHwqEo= Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20cf6eea3c0so28931525ad.0 for ; Sun, 03 Nov 2024 22:16:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730700985; x=1731305785; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hw53jXy9qBKwtFSemKjWyJ+vIk9C3EOUGoD/zAntvXg=; b=pnPYgFT/SBzJDezIAw8zKPbZQq4IdHkN7TKHiNeL6mHuTOg3DKOJ1E72GGI8zlrxp4 4wKjvyxxSpZ1s+wAKYJtkc3ifUj2M2OUAYifOA9EIrsgiishQpNS/etH8mZQGG8/HZfY Tg3mtpRB61TRI4To+Q17ytj8RE6PAtlNkv5dys3WcIEP6bU6i3IfyCLgy4E42RJ81J79 yLwPbtKQwEYNGA//N7AVQq9ArCvMNNW5ybDdgM7UnvRsqOhPotRw45lwpUXrQh1Edwo2 KUqtZl+TaulAGciJcbM+1k03zU7pePEO4Z7dI/EHluKQA37egXWLP5gENCDylAY4a8j6 94PA== X-Forwarded-Encrypted: i=1; AJvYcCVE2yFblyyjvzyH+OrGIoabhm4viRjMw9rw6P/mxLAzOFwYu0jn5t8ldraJuPgJfDpKQlBmXcoBjQ==@kvack.org X-Gm-Message-State: AOJu0YzzNxf8x7qoUUmVyN0s5ZYAqrvriYGCo4zvyCNKjKU9NeOw7QTx OSYVOE0oVfnZ1w3XKQLVLvSzqttxZmlwW8NNpxExnVw7HUZ4+G7N X-Google-Smtp-Source: AGHT+IEqy4N7gVGTGPGQfiEM2AfvUgixDNq8Cu94wABIghm8HqNKD094sS0a/Np8T8AVx5qL2gExFA== X-Received: by 2002:a17:902:d485:b0:20c:7c09:b2ac with SMTP id d9443c01a7336-210c6c5db72mr402280195ad.52.1730700984505; Sun, 03 Nov 2024 22:16:24 -0800 (PST) Received: from localhost.localdomain (144.34.241.68.16clouds.com. [144.34.241.68]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21105709bdesm54808705ad.94.2024.11.03.22.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 22:16:24 -0800 (PST) From: Ke Sun To: Andrew Morton , "Liam R. Howlett" Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Ke Sun Subject: [PATCH] maple_tree: use KMEM_CACHE to create maple_node caches Date: Mon, 4 Nov 2024 14:16:17 +0800 Message-Id: <20241104061617.450907-1-sunke@kylinos.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 4116580009 X-Rspamd-Server: rspam11 X-Stat-Signature: fbck843rwu834syy7sskfmygg6d1hqhr X-HE-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yU+XLaUy042k3wxyY81VSq3fgnfqx48sriYfUgwPmmqlUtCIrBKD2ZA9dJZvAaTEDY/Pvu1eRkQAw9d1Cayc4jf0D5fuc/VTfPXWWN5DAewR7KMYd50RuyvWaZo1jcQmFIQ0z7Yu5W9ufYnaj83NigyXQBZVzN0qctodNZJYVmkOKlE+lmQIjwckdkQZpvCZjq2GR0RkJygOmUm1v6n4KmTBbxkcqgyA25u9l8miqgeKev9GWgkBuyUG4vfFmH5vhPEaY35wVDu13I6q26dUgHkumTA+VWb9kVzIy1VLJxtR8 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify the creation of SLAB caches. Signed-off-by: Ke Sun --- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3619301dda2e..60be142e35c6 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6299,9 +6299,7 @@ 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); + maple_node_cache = KMEM_CACHE(maple_node, SLAB_PANIC); } /**