From patchwork Tue Jun 18 01:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongfu Li X-Patchwork-Id: 13701685 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 CD46DC27C79 for ; Tue, 18 Jun 2024 01:45:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23A4E6B02B7; Mon, 17 Jun 2024 21:45:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E8856B02B8; Mon, 17 Jun 2024 21:45:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D8156B02B9; Mon, 17 Jun 2024 21:45:50 -0400 (EDT) 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 E5DD46B02B7 for ; Mon, 17 Jun 2024 21:45:49 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 8ADAC1C0B8B for ; Tue, 18 Jun 2024 01:45:49 +0000 (UTC) X-FDA: 82242318018.15.C4D2891 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by imf04.hostedemail.com (Postfix) with ESMTP id 87F8440011 for ; Tue, 18 Jun 2024 01:45:46 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of lihongfu@kylinos.cn designates 124.126.103.232 as permitted sender) smtp.mailfrom=lihongfu@kylinos.cn ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718675142; a=rsa-sha256; cv=none; b=te1q7Y/Z74ZpK76z1j9ndBFBS9Y/BimFvrXugZuvzBj7ANsuE7wgw5qFdE4kbNkzw41tVZ mCbSWgnU5II/ibMNj9x+6NNTaF4aQCREJRTShhvum8TWzNtguc4unaEoLfEpZ1P9tzar8+ ELknLNRS6sXlfMS6LcvC9bglsdUnnrg= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of lihongfu@kylinos.cn designates 124.126.103.232 as permitted sender) smtp.mailfrom=lihongfu@kylinos.cn ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718675142; 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=G3gTgGi+nbAHVNmy7YN0ATX5qvfOdHRnvp3P9vbKVn4=; b=Xi6oTAwlMWh4A8AmtcXuPUM8WdO4tma0x5XgKzYeTZ6s6UqYiYNqCgngEG5VScV8rTOaTW 5E2zARjxtCMK+qKqTRXZWnjPoUzhB6zVdDHRwvL9+uGddA+64/0/ZodLdiL8E7S8qXZdzQ gDPXepUaZSJWcq+HtYTcZnwA/jkndGs= X-UUID: 7497720e2d1411ef9305a59a3cc225df-20240618 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:c3f8d9b5-79d8-4cab-8348-7e72cbe7caab,IP:15, URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:5 X-CID-INFO: VERSION:1.1.38,REQID:c3f8d9b5-79d8-4cab-8348-7e72cbe7caab,IP:15,UR L:0,TC:0,Content:-5,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:5 X-CID-META: VersionHash:82c5f88,CLOUDID:de079e7db15eee2918a1ab7ec45f4431,BulkI D:24061809453831AL2JP5,BulkQuantity:0,Recheck:0,SF:66|24|72|19|44|102,TC:n il,Content:0,EDM:-3,IP:-2,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM, HR_SJ_PHRASE HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED, SA_UNTRUSTED, SA_UNFAMILIAR SN_UNTRUSTED, SN_UNFAMILIAR, SPF_NOPASS, DKIM_NOPASS, DMARC_NOPASS CIE_BAD, CIE_GOOD, CIE_GOOD_SPF, GTI_FG_BS, GTI_RG_INFO GTI_C_BU, AMN_T1, AMN_GOOD, AMN_C_TI, AMN_C_BU ABX_MISS_RDNS X-UUID: 7497720e2d1411ef9305a59a3cc225df-20240618 X-User: lihongfu@kylinos.cn Received: from localhost.localdomain [(223.70.159.255)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 2099277101; Tue, 18 Jun 2024 09:45:35 +0800 From: Hongfu Li To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hongfu Li Subject: [PATCH] khugepaged: Simplify the allocation of slab caches Date: Tue, 18 Jun 2024 09:45:17 +0800 Message-Id: <20240618014517.25954-1-lihongfu@kylinos.cn> X-Mailer: git-send-email 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LxjIH+hICQBqsHtkl8EG08SyuDaZoDIfnjTUn3jhsneN/0f6WwWz FRuKlqKG wL050dHrWgiBRBYkFACeMMDMUsKhSbIV0awWh 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 new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Hongfu Li Acked-by: David Hildenbrand --- mm/khugepaged.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 774a97e6e2da..f8d08b49420c 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -385,10 +385,7 @@ int hugepage_madvise(struct vm_area_struct *vma, int __init khugepaged_init(void) { - mm_slot_cache = kmem_cache_create("khugepaged_mm_slot", - sizeof(struct khugepaged_mm_slot), - __alignof__(struct khugepaged_mm_slot), - 0, NULL); + mm_slot_cache = KMEM_CACHE(khugepaged_mm_slot, 0); if (!mm_slot_cache) return -ENOMEM;