From nobody Sun Feb 8 20:28:29 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3A393DB8B for ; Wed, 21 Feb 2024 10:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509638; cv=none; b=Z8rY5qVLPxd2aqOr078cj2nu7nI9qpXktpYLQsdt5BJGHx/qRTSDzs8Il/9gmAbWP98IVR6miYro6Lc0opRWp6xdIw/MH+CTIDn7JkzIgXeEHF2c+gsFszzlntD5hCTQxUb9cJsKjudUIVY/msTCpEdd31NvHltr/nin4tdHqEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509638; c=relaxed/simple; bh=iNK1j0Yg3W8SG48bEV/m85JuGiivmYKOT1ZQLl8TNe0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vBUHtuoxJS5H0khHnhes4QK1Perm/kwEnaIFpjThoGVvXPIbdIRadsn8e+dGAYTC2xi3uEYYTkQWdDk5NOSuRY2+SMPnfpbs1RiElB1Gm2o88qs+DlxCcE2LP7NqSgRLVswVHXvMs66jH48wgR7hlcV4z0noA0UqoBowCdXtmlg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 6c386430499b4389a9f0883f1c0d84e6-20240221 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:3f8f4e42-865d-459e-8215-6035bc0ce356,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.35,REQID:3f8f4e42-865d-459e-8215-6035bc0ce356,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:0df7a480-4f93-4875-95e7-8c66ea833d57,B ulkID:240221180024PLCRANR9,BulkQuantity:0,Recheck:0,SF:38|24|17|19|44|66|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File: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_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS X-UUID: 6c386430499b4389a9f0883f1c0d84e6-20240221 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1480455945; Wed, 21 Feb 2024 18:00:22 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id EE804E000EBC; Wed, 21 Feb 2024 18:00:21 +0800 (CST) X-ns-mid: postfix-65D5C9B5-768232112 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 0AE6BE000EBD; Wed, 21 Feb 2024 18:00:20 +0800 (CST) From: Kunwu Chan To: alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH 1/3] drm/amdgpu: Simplify the allocation of fence slab caches Date: Wed, 21 Feb 2024 17:59:05 +0800 Message-Id: <20240221095907.172408-2-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240221095907.172408-1-chentao@kylinos.cn> References: <20240221095907.172408-1-chentao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan Reviewed-by: Christian K=C3=B6nig for the entire=20 --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/am= d/amdgpu/amdgpu_fence.c index 70bff8cecfda..10832b470448 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -61,9 +61,7 @@ static struct kmem_cache *amdgpu_fence_slab; =20 int amdgpu_fence_slab_init(void) { - amdgpu_fence_slab =3D kmem_cache_create( - "amdgpu_fence", sizeof(struct amdgpu_fence), 0, - SLAB_HWCACHE_ALIGN, NULL); + amdgpu_fence_slab =3D KMEM_CACHE(amdgpu_fence, SLAB_HWCACHE_ALIGN); if (!amdgpu_fence_slab) return -ENOMEM; return 0; --=20 2.39.2 From nobody Sun Feb 8 20:28:29 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D9493D0DB for ; Wed, 21 Feb 2024 10:00:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509637; cv=none; b=W/j8m8kPbPhRSLWqK/5MOLWJ8WUSryHbX4mT//9Uoe5by9OuriXuttkNul/H4DPos/TgbdL+aldQ+CA/C5gkSL1utCjNzCVU/1KOezV3IoTJOB4QIPwWRSvna1C9YtDBG1sbg9YcUWVJ+r/nbVzJ3MqOcPfEowQ7PD05itpgOd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509637; c=relaxed/simple; bh=WACsM7dJmS81ncmkq8piKSWMNJkIk8muLxBwnbX9UVo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Bw9LAeovcS6Ls7Gld5MZ/8N8zijsSW6MwzeQ5WqlHW7KmlUv+GtKxyN6/FACtOBk6u/FyVuFXSxsr8kz4hJCTG2rMC672nl3c+Wn6tZxktNsOezH6nRq3xq8lswgACGGm0EH8R9BasaKy37S/vTsfBkObQ4ZBFy80rpOutRQfEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 6e9d739c276e4191b279f4b18a21d38c-20240221 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:bb9b2bf2-8df8-4184-8d98-646f3b3f6425,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.35,REQID:bb9b2bf2-8df8-4184-8d98-646f3b3f6425,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:0ef7a480-4f93-4875-95e7-8c66ea833d57,B ulkID:240221180024PLCRANR9,BulkQuantity:1,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:43,QS:nil,BEC:nil,COL :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_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 6e9d739c276e4191b279f4b18a21d38c-20240221 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 583708194; Wed, 21 Feb 2024 18:00:23 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id C5E52E000EBC; Wed, 21 Feb 2024 18:00:22 +0800 (CST) X-ns-mid: postfix-65D5C9B6-558034113 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 0BE8DE000EBD; Wed, 21 Feb 2024 18:00:21 +0800 (CST) From: Kunwu Chan To: alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH 2/3] drm/amdgpu: Simplify the allocation of mux_chunk slab caches Date: Wed, 21 Feb 2024 17:59:06 +0800 Message-Id: <20240221095907.172408-3-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240221095907.172408-1-chentao@kylinos.cn> References: <20240221095907.172408-1-chentao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan Reviewed-by: Christian K=C3=B6nig for the entire=20 --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c b/drivers/gpu/drm= /amd/amdgpu/amdgpu_ring_mux.c index e1ee1c7117fb..d234b7ccfaaf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c @@ -159,9 +159,7 @@ int amdgpu_ring_mux_init(struct amdgpu_ring_mux *mux, s= truct amdgpu_ring *ring, mux->ring_entry_size =3D entry_size; mux->s_resubmit =3D false; =20 - amdgpu_mux_chunk_slab =3D kmem_cache_create("amdgpu_mux_chunk", - sizeof(struct amdgpu_mux_chunk), 0, - SLAB_HWCACHE_ALIGN, NULL); + amdgpu_mux_chunk_slab =3D KMEM_CACHE(amdgpu_mux_chunk, SLAB_HWCACHE_ALIGN= ); if (!amdgpu_mux_chunk_slab) { DRM_ERROR("create amdgpu_mux_chunk cache failed\n"); return -ENOMEM; --=20 2.39.2 From nobody Sun Feb 8 20:28:29 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A0C63D54C for ; Wed, 21 Feb 2024 10:00:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509639; cv=none; b=KnD2+vzT6wNHnZsAdb8QAmHqTOspaT2JwsZNH3IOS+FpzQ3pjA7ZF8CTR0KJfUSqWljmFMre26qI3MsIYsEAeDTmC2iNDsafPCAzitcUDmn8exbXYUIH2Pd0rQBMvfoCJ88b/IdTbv3H2KFXOyCUpthfJ0UAOGMzkO1cjVs1fq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509639; c=relaxed/simple; bh=MGZaqLmMzO6wbM7prH14xhw2vpbo3yMc/zyQLmT9EFs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HAzRDjxY55KyLwbP7i0/b5YHjjfVMSP7qiNmRhwK8jfKR4tegEtfXkFm/MUleQJFiRCwxLe3BHmVwOmoHkAkDyqy4xPCxbTNEVsetxGc701IfePePL11S/OlOIzNHiOv6Fo3t3Y4y3SJiLUxZkKndjEyWxO8qEk3VQXTxn/PWpo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 02cc5fc8cccf4f98ab5783f712d703ca-20240221 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:623a14fd-5008-4c40-89be-891b8c45b351,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.35,REQID:623a14fd-5008-4c40-89be-891b8c45b351,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:deed8b8f-e2c0-40b0-a8fe-7c7e47299109,B ulkID:2402211800264WKWF8CQ,BulkQuantity:0,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File: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_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 02cc5fc8cccf4f98ab5783f712d703ca-20240221 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 156901990; Wed, 21 Feb 2024 18:00:23 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 9FE0CE000EBC; Wed, 21 Feb 2024 18:00:23 +0800 (CST) X-ns-mid: postfix-65D5C9B7-383174114 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id D4F04E000EBD; Wed, 21 Feb 2024 18:00:22 +0800 (CST) From: Kunwu Chan To: alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH 3/3] drm/amdgpu: Simplify the allocation of sync slab caches Date: Wed, 21 Feb 2024 17:59:07 +0800 Message-Id: <20240221095907.172408-4-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240221095907.172408-1-chentao@kylinos.cn> References: <20240221095907.172408-1-chentao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan Reviewed-by: Christian K=C3=B6nig for the entire=20 --- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd= /amdgpu/amdgpu_sync.c index 1b013a44ca99..bdf1ef825d89 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c @@ -441,9 +441,7 @@ void amdgpu_sync_free(struct amdgpu_sync *sync) */ int amdgpu_sync_init(void) { - amdgpu_sync_slab =3D kmem_cache_create( - "amdgpu_sync", sizeof(struct amdgpu_sync_entry), 0, - SLAB_HWCACHE_ALIGN, NULL); + amdgpu_sync_slab =3D KMEM_CACHE(amdgpu_sync_entry, SLAB_HWCACHE_ALIGN); if (!amdgpu_sync_slab) return -ENOMEM; =20 --=20 2.39.2