From: sashiko-bot@kernel.org
To: "Karol Wachowski" <karol.wachowski@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/ivpu: use kmem_cache for IPC rx_msg allocations
Date: Thu, 11 Jun 2026 06:04:47 +0000 [thread overview]
Message-ID: <20260611060448.197F71F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260611055214.948748-1-karol.wachowski@linux.intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Duplicate kmem_cache name on multi-device systems
--
commit 41c16409be6704d2ef5ab21270390fee65dcf7aa
Author: Karol Wachowski <karol.wachowski@linux.intel.com>
accel/ivpu: use kmem_cache for IPC rx_msg allocations
This commit introduces a dedicated kmem_cache for allocating IPC rx_msg
objects to reduce allocator overhead in IRQ handlers.
> diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c
> --- a/drivers/accel/ivpu/ivpu_ipc.c
> +++ b/drivers/accel/ivpu/ivpu_ipc.c
[ ... ]
> @@ -490,10 +490,18 @@ int ivpu_ipc_init(struct ivpu_device *vdev)
> struct ivpu_ipc_info *ipc = vdev->ipc;
> int ret;
>
> + ipc->rx_msg_cache = kmem_cache_create("ivpu_ipc_rx_msg", sizeof(struct ivpu_ipc_rx_msg), 0,
> + SLAB_HWCACHE_ALIGN, NULL);
[Severity: Medium]
Will this cause a name collision if there are multiple ivpu devices in the
same system?
Since this is initialized per-device in ivpu_ipc_init(), calling
kmem_cache_create() multiple times with the same hardcoded string
"ivpu_ipc_rx_msg" can trigger a kernel WARN in kmem_cache_sanity_check()
when CONFIG_DEBUG_VM is enabled.
Furthermore, if SLUB merging is disabled via boot parameters or config,
the duplicate name causes a sysfs kobject collision, leading to a sysfs
warning and a failure to register the cache in sysfs.
Should this cache name be made unique per device using dev_name(), or
should the cache be a global singleton?
> + if (!ipc->rx_msg_cache) {
> + ivpu_err(vdev, "Failed to create rx_msg_cache\n");
> + return -ENOMEM;
> + }
> +
> ipc->mem_tx = ivpu_bo_create_global(vdev, SZ_16K, DRM_IVPU_BO_WC | DRM_IVPU_BO_MAPPABLE);
> if (!ipc->mem_tx) {
> ivpu_err(vdev, "Failed to allocate mem_tx\n");
> - return -ENOMEM;
> + ret = -ENOMEM;
> + goto err_destroy_cache;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260611055214.948748-1-karol.wachowski@linux.intel.com?part=1
next prev parent reply other threads:[~2026-06-11 6:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 5:52 [PATCH] accel/ivpu: use kmem_cache for IPC rx_msg allocations Karol Wachowski
2026-06-11 6:04 ` sashiko-bot [this message]
2026-06-11 7:58 ` Wachowski, Karol
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260611060448.197F71F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=karol.wachowski@linux.intel.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.