From: Breno Leitao <[email protected]>
To: Gabriel Krisman Bertazi <[email protected]>
Cc: [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected], [email protected]
Subject: Re: [PATCH v3 1/2] io_uring: Move from hlist to io_wq_work_node
Date: Fri, 24 Feb 2023 01:55:20 -0800 [thread overview]
Message-ID: <Y/[email protected]> (raw)
In-Reply-To: <[email protected]>
Hello Krisman, thanks for the review
On Thu, Feb 23, 2023 at 04:02:25PM -0300, Gabriel Krisman Bertazi wrote:
> Breno Leitao <[email protected]> writes:
> > static inline struct io_cache_entry *io_alloc_cache_get(struct io_alloc_cache *cache)
> > {
> > - if (!hlist_empty(&cache->list)) {
> > - struct hlist_node *node = cache->list.first;
> > + if (cache->list.next) {
> > + struct io_cache_entry *entry;
> >
> > - hlist_del(node);
> > - return container_of(node, struct io_cache_entry, node);
> > + entry = container_of(cache->list.next, struct io_cache_entry, node);
> > + cache->list.next = cache->list.next->next;
> > + return entry;
> > }
>
> From a quick look, I think you could use wq_stack_extract() here
True, we can use wq_stack_extract() in this patch, but, we would need to
revert to back to this code in the next patch. Remember that
wq_stack_extract() touches the stack->next->next, which will be
poisoned, causing a KASAN warning.
Here is relevant part of the code:
struct io_wq_work_node *wq_stack_extract(struct io_wq_work_node *stack)
{
struct io_wq_work_node *node = stack->next;
stack->next = node->next;
next prev parent reply other threads:[~2023-02-24 9:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 16:43 [PATCH v3 0/2] io_uring: Add KASAN support for alloc caches Breno Leitao
2023-02-23 16:43 ` [PATCH v3 1/2] io_uring: Move from hlist to io_wq_work_node Breno Leitao
2023-02-23 19:02 ` Gabriel Krisman Bertazi
2023-02-23 19:39 ` Jens Axboe
2023-02-24 18:32 ` Gabriel Krisman Bertazi
2023-02-24 19:41 ` Jens Axboe
2023-02-24 9:55 ` Breno Leitao [this message]
2023-02-23 16:43 ` [PATCH v3 2/2] io_uring: Add KASAN support for alloc_caches Breno Leitao
2023-02-23 19:09 ` Gabriel Krisman Bertazi
2023-03-16 19:01 ` [PATCH v3 0/2] io_uring: Add KASAN support for alloc caches 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=Y/[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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