From: Jens Axboe <axboe@kernel.dk>
To: lizetao <lizetao1@huawei.com>,
"io-uring@vger.kernel.org" <io-uring@vger.kernel.org>
Subject: Re: [PATCH 5/6] io_uring/futex: use generic io_cancel_remove() helper
Date: Thu, 6 Feb 2025 07:10:29 -0700 [thread overview]
Message-ID: <d7215f82-f83b-46d6-802a-d9e4647bccd3@kernel.dk> (raw)
In-Reply-To: <c619c868b7b442cc9a2c669522242d96@huawei.com>
On 2/6/25 5:56 AM, lizetao wrote:
> Hi,
>
>> -----Original Message-----
>> From: Jens Axboe <axboe@kernel.dk>
>> Sent: Thursday, February 6, 2025 4:26 AM
>> To: io-uring@vger.kernel.org
>> Cc: Jens Axboe <axboe@kernel.dk>
>> Subject: [PATCH 5/6] io_uring/futex: use generic io_cancel_remove() helper
>>
>> Don't implement our own loop rolling and checking, just use the generic helper to
>> find and cancel requests.
>>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>> ---
>> io_uring/futex.c | 24 +-----------------------
>> 1 file changed, 1 insertion(+), 23 deletions(-)
>>
>> diff --git a/io_uring/futex.c b/io_uring/futex.c index
>> 808eb57f1210..54b9760f2aa6 100644
>> --- a/io_uring/futex.c
>> +++ b/io_uring/futex.c
>> @@ -116,29 +116,7 @@ static bool __io_futex_cancel(struct io_kiocb *req) int
>> io_futex_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
>> unsigned int issue_flags)
>> {
>> - struct hlist_node *tmp;
>> - struct io_kiocb *req;
>> - int nr = 0;
>> -
>> - if (cd->flags &
>> (IORING_ASYNC_CANCEL_FD|IORING_ASYNC_CANCEL_FD_FIXED))
>> - return -ENOENT;
>
> Why remove this check?
It isn't really necessary. Yes we could loop pointlessly if they are set
and not find anything, but it's really just a bad use case from the
application. End result should be the same, that -ENOENT is returned on
trying to lookup a futex operation based on the fd.
--
Jens Axboe
next prev parent reply other threads:[~2025-02-06 14:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 20:26 [PATCHSET 0/6] Cancelation cleanups Jens Axboe
2025-02-05 20:26 ` [PATCH 1/6] io_uring/cancel: add generic remove_all helper Jens Axboe
2025-02-06 12:46 ` lizetao
2025-02-06 14:07 ` Jens Axboe
2025-02-05 20:26 ` [PATCH 2/6] io_uring/futex: convert to io_cancel_remove_all() Jens Axboe
2025-02-05 20:26 ` [PATCH 3/6] io_uring/waitid: " Jens Axboe
2025-02-05 20:26 ` [PATCH 4/6] io_uring/cancel: add generic cancel helper Jens Axboe
2025-02-05 20:26 ` [PATCH 5/6] io_uring/futex: use generic io_cancel_remove() helper Jens Axboe
2025-02-06 12:56 ` lizetao
2025-02-06 14:10 ` Jens Axboe [this message]
2025-02-05 20:26 ` [PATCH 6/6] io_uring/waitid: " Jens Axboe
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=d7215f82-f83b-46d6-802a-d9e4647bccd3@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=lizetao1@huawei.com \
/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