From patchwork Tue Jun 18 08:12:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13701918 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 D2A1FC2BA15 for ; Tue, 18 Jun 2024 07:48:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F85F6B02B0; Tue, 18 Jun 2024 03:48:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A8AA6B02B1; Tue, 18 Jun 2024 03:48:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 370C06B02B2; Tue, 18 Jun 2024 03:48:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 1A5306B02B0 for ; Tue, 18 Jun 2024 03:48:36 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8930440525 for ; Tue, 18 Jun 2024 07:48:35 +0000 (UTC) X-FDA: 82243232190.12.D6B8875 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf27.hostedemail.com (Postfix) with ESMTP id 9F22F40016 for ; Tue, 18 Jun 2024 07:48:31 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718696907; a=rsa-sha256; cv=none; b=ZZ3EbxYa+vC3n/0bjOBBhQt4jCMJUv5p7Af0hYXBActWpKvv8fVa2ZD7JSzA8dbeEoxXM1 ZKKQI9fd0IJC4cvor8Tkr57b+gaSaT3sE1lyGWfbKGrH/Qs9Vw/H3+enZoXVgR4Ubv7CAS 1qWMGDGNzlPwbMWkp0K9k10pY1QSr0o= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718696907; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=q2o82lAkf0NukPu/Ko5BFCn54VMCsm+zH2tYWyUYQSo=; b=wJWWaqiz94K0QxU6wus26gtF2+QfKhaArjsaxaiXzjj+IsfEN1dtJ4SQHfRNzJYbDScEoC LjEAi/MykVQkPpVPkY15D6JQTvkb7X2FMdKM1fo++ngIG8lDNQ4fvdYcV5vWyDY1Dt2uXg 2fhPczjQOua5zk67bs9/gMC6gZh2etk= Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4W3Jg64G6mz2CkJC; Tue, 18 Jun 2024 15:44:34 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 663691A0188; Tue, 18 Jun 2024 15:48:27 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 18 Jun 2024 15:48:26 +0800 From: Kefeng Wang To: Andrew Morton CC: , David Hildenbrand , Kefeng Wang Subject: [PATCH] mm: ksm: drop KSM_KMEM_CACHE() Date: Tue, 18 Jun 2024 16:12:01 +0800 Message-ID: <20240618081201.134985-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 9F22F40016 X-Stat-Signature: qejgq6hi78gducd47dy441bpk66hup4i X-Rspam-User: X-HE-Tag: 1718696911-959577 X-HE-Meta: U2FsdGVkX1/4UCk80hHWotL1u4hlRl/dK4g3MWDGi9qG21enqSkhMyiPSnC5K6wUjaeNZOyecZd+0GKFDMlap4+oOcZ2ZAsyK72W6UQrZiw9ZYdB37+56vmcpCT8lpvO9QFKs9HF07XTjfZw6GTGI7VsWmkU6WVm/qJyUpBr7MWViSC6EV1YYCpUf3+4UAMuo4QejJnTYyjfgkMQ4jtkkRocS3Vyt6VF4Woz0n4zGZuBkbTvoBTFu6QhUekEfE9uc6WfmxoZT7edpkMOjo0ZLdnjwmF/u9p7GCzVqjinuado/YhorXLHC/hR4ttt5Ulof6+A1NkW/OLIp3MaMi/ErzvNkP7kD83hIgG0Ik3qNcBIff85sMsS1/zfAu/8q2ZguDJRJtKZqiOlz8JPZg/Qz/cDKXjwHhcUGo4CCRBe4h+1u3KNSecWEkDEnZNzhVEs35ZmkUR4e43ODGG6Im39kN7cr238nYNMn7dTLcXB2NuaP9kFKa1m5nkEFShoH39xv1Zh5AIp8d2Od1OwRl85Qp5ofRUHKYxqY9N3ZW43o4iXO76wrNl+nMkeuDurTLo6Q6NI/xx9MGKM28071ICIEWCV9m2FmQZ6smqh3BHvb7ZxvuX2wZ7A3rh+52bbcD+ntT3vmBaTPmO383qmcmLGK9oQimKkaNksXJjiMzpDiKkGpde+zpFvodbagXHiZZXiOWuqrtzVt2Rjpk929duFK7u/Ts150oo2hSal3/GekgXA6xbv3ASfnFEFkiYfxc+bAASdlWj0/DQ1SqtXRHG3Fb7nv0jS+Ex/QBXH7Cj4NTmrKoeH6AkZza7rgBTOCDsXLJmncZ4Tq1smHMTJWPLBTXxoh4z6uMiCdFXuVpJNCuLX541Q2zZAZDuovMI8a/pIiFiiX93jxxYbGz546CkHGO2lqxf+MS0gr26QiLEyL5bDAoAix4mnzYKLka8Ni83UuAu7/EQRhgfYygjpiRT qK2wce9M lfg3Qbfq+3lycS20Iy3sbkbZvAhcHlmKdpea6px+/y6wpj8LGQg4gdOOEjqu0o16XkwNq7ZRrbeJr2PupUBemzXERzVnzTj4/nN1s0uw0R7iJqshp+Rp2puLMqe9VNAe2FscTAM/Ueir7aLitURBDUjFaSO6lwMi0rXeUWuB0/d+WezVyUVkXN1p4F4g3uic2VwLa 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: After commit 21fbd59136e0 ("ksm: add the ksm prefix to the names of the ksm private structures"), we could directly use KMEM_CACHE(). Signed-off-by: Kefeng Wang Acked-by: David Hildenbrand --- mm/ksm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index d2641bc2efc9..1f62797c9809 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -488,21 +488,17 @@ static DECLARE_WAIT_QUEUE_HEAD(ksm_iter_wait); static DEFINE_MUTEX(ksm_thread_mutex); static DEFINE_SPINLOCK(ksm_mmlist_lock); -#define KSM_KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ - sizeof(struct __struct), __alignof__(struct __struct),\ - (__flags), NULL) - static int __init ksm_slab_init(void) { - rmap_item_cache = KSM_KMEM_CACHE(ksm_rmap_item, 0); + rmap_item_cache = KMEM_CACHE(ksm_rmap_item, 0); if (!rmap_item_cache) goto out; - stable_node_cache = KSM_KMEM_CACHE(ksm_stable_node, 0); + stable_node_cache = KMEM_CACHE(ksm_stable_node, 0); if (!stable_node_cache) goto out_free1; - mm_slot_cache = KSM_KMEM_CACHE(ksm_mm_slot, 0); + mm_slot_cache = KMEM_CACHE(ksm_mm_slot, 0); if (!mm_slot_cache) goto out_free2;