From: Fenghua Yu <fenghua.yu@intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Dave Jiang <dave.jiang@intel.com>, Vinod Koul <vkoul@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
<dmaengine@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: idxd: Remove a useless mutex
Date: Sat, 2 Nov 2024 16:49:34 -0700 [thread overview]
Message-ID: <5bcd5045-d1f4-fa0f-acc9-31517cd456cc@intel.com> (raw)
In-Reply-To: <e08df764e7046178ada4ec066852c0ce65410373.1730547933.git.christophe.jaillet@wanadoo.fr>
On 11/2/24 04:46, Christophe JAILLET wrote:
> ida_alloc()/ida_free() don't need any mutex, so remove this one.
>
> It was introduced by commit e6fd6d7e5f0f ("dmaengine: idxd: add a device to
> represent the file opened").
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Thanks.
-Fenghua
> ---
> See:
> https://elixir.bootlin.com/linux/v6.11.2/source/lib/idr.c#L375
> https://elixir.bootlin.com/linux/v6.11.2/source/lib/idr.c#L484
> ---
> drivers/dma/idxd/cdev.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
> index 57f1bf2ab20b..ff94ee892339 100644
> --- a/drivers/dma/idxd/cdev.c
> +++ b/drivers/dma/idxd/cdev.c
> @@ -28,7 +28,6 @@ struct idxd_cdev_context {
> * global to avoid conflict file names.
> */
> static DEFINE_IDA(file_ida);
> -static DEFINE_MUTEX(ida_lock);
>
> /*
> * ictx is an array based off of accelerator types. enum idxd_type
> @@ -123,9 +122,7 @@ static void idxd_file_dev_release(struct device *dev)
> struct idxd_device *idxd = wq->idxd;
> int rc;
>
> - mutex_lock(&ida_lock);
> ida_free(&file_ida, ctx->id);
> - mutex_unlock(&ida_lock);
>
> /* Wait for in-flight operations to complete. */
> if (wq_shared(wq)) {
> @@ -284,9 +281,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
> }
>
> idxd_cdev = wq->idxd_cdev;
> - mutex_lock(&ida_lock);
> ctx->id = ida_alloc(&file_ida, GFP_KERNEL);
> - mutex_unlock(&ida_lock);
> if (ctx->id < 0) {
> dev_warn(dev, "ida alloc failure\n");
> goto failed_ida;
next prev parent reply other threads:[~2024-11-02 23:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-02 11:46 [PATCH] dmaengine: idxd: Remove a useless mutex Christophe JAILLET
2024-11-02 23:49 ` Fenghua Yu [this message]
2024-11-04 15:18 ` Dave Jiang
2024-12-02 17:31 ` Vinod Koul
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=5bcd5045-d1f4-fa0f-acc9-31517cd456cc@intel.com \
--to=fenghua.yu@intel.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox