[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41a120c8-e5ad-4a0f-96cf-1159d5d1b4e1@intel.com>
Date: Fri, 11 Apr 2025 13:34:28 -0700
From: Dave Jiang <dave.jiang@...el.com>
To: Eder Zulian <ezulian@...hat.com>, Basavaraj.Natikar@....com,
vkoul@...nel.org, dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: jsnitsel@...hat.com, ddutile@...hat.com
Subject: Re: [PATCH RFC 1/1] dmaengine: ptdma: use SLAB_TYPESAFE_BY_RCU for
the DMA descriptor slab
On 4/11/25 12:41 PM, Eder Zulian wrote:
> The SLAB_TYPESAFE_BY_RCU flag prevents a change of type for objects
> allocated from the slab cache (although the memory may be reallocated to
> a completetly different object of the same type.) Moreover, when the
> last reference to an object is dropped the finalization code must not
> run until all __rcu pointers referencing the object have been updated,
> and then a grace period has passed.
I would pull some of the explanation on why and how from your cover. Also, a fixes tag may be needed?
DJ
>
> Signed-off-by: Eder Zulian <ezulian@...hat.com>
> ---
> drivers/dma/amd/ptdma/ptdma-dmaengine.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/amd/ptdma/ptdma-dmaengine.c b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> index 715ac3ae067b..b70dd1b0b9fb 100644
> --- a/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> +++ b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> @@ -597,7 +597,8 @@ int pt_dmaengine_register(struct pt_device *pt)
>
> pt->dma_desc_cache = kmem_cache_create(desc_cache_name,
> sizeof(struct pt_dma_desc), 0,
> - SLAB_HWCACHE_ALIGN, NULL);
> + SLAB_HWCACHE_ALIGN |
> + SLAB_TYPESAFE_BY_RCU, NULL);
> if (!pt->dma_desc_cache) {
> ret = -ENOMEM;
> goto err_cache;
Powered by blists - more mailing lists