From: Christoph Hellwig <hch@lst.de>
To: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Christoph Hellwig <hch@lst.de>,
axboe@kernel.dk, ming.lei@redhat.com, tj@kernel.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Chengming Zhou <zhouchengming@bytedance.com>
Subject: Re: [PATCH v2 1/4] blk-mq: use percpu csd to remote complete instead of per-rq csd
Date: Thu, 6 Jul 2023 16:39:46 +0200 [thread overview]
Message-ID: <20230706143946.GA15131@lst.de> (raw)
In-Reply-To: <f6f52b55-a991-1179-75cb-bf8fce8f6783@linux.dev>
On Thu, Jul 06, 2023 at 10:23:49PM +0800, Chengming Zhou wrote:
> Yes, should I change like below? Looks like much long code. :-)
>
> if (llist_add(&rq->ipi_list, &per_cpu(blk_cpu_done, cpu)))
> smp_call_function_single_async(cpu, &per_cpu(blk_cpu_csd, cpu));
Doesn't look bad too me.
>
>
> >
> > But I think this code has a rpboem when it is preemptd between
> > the llist_add and smp_call_function_single_async. We either need a
> > get_cpu/put_cpu around them, or instroduce a structure with the list
> > and csd, and then you can use one pointer from per_cpu and still ensure
> > the list and csd are for the same CPU.
> >
>
> cpu = rq->mq_ctx->cpu; So it's certainly the same CPU, right?
You're right of couse - cpu is the submitting cpu and not the current
one and thus not affected by preemption. Sorry for the noise.
next prev parent reply other threads:[~2023-07-06 14:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 11:03 [PATCH v2 0/4] blk-mq: optimize the size of struct request chengming.zhou
2023-06-29 11:03 ` [PATCH v2 1/4] blk-mq: use percpu csd to remote complete instead of per-rq csd chengming.zhou
2023-07-05 15:01 ` Ming Lei
2023-07-06 13:07 ` Christoph Hellwig
2023-07-06 14:23 ` Chengming Zhou
2023-07-06 14:39 ` Christoph Hellwig [this message]
2023-06-29 11:03 ` [PATCH v2 2/4] blk-flush: count inflight flush_data requests chengming.zhou
2023-07-05 15:10 ` Ming Lei
2023-07-06 13:08 ` Christoph Hellwig
2023-06-29 11:03 ` [PATCH v2 3/4] blk-flush: reuse rq queuelist in flush state machine chengming.zhou
2023-07-06 13:08 ` Christoph Hellwig
2023-06-29 11:03 ` [PATCH v2 4/4] blk-mq: delete unused completion_data in struct request chengming.zhou
2023-07-06 13:08 ` Christoph Hellwig
2023-07-06 14:31 ` Chengming Zhou
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=20230706143946.GA15131@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=chengming.zhou@linux.dev \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=tj@kernel.org \
--cc=zhouchengming@bytedance.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 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.