From: "Li,Rongqing" <lirongqing@baidu.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Subject: 答复: [PATCH] virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq
Date: Tue, 31 Aug 2021 02:09:36 +0000 [thread overview]
Message-ID: <bbf978c3252b4f2ea13ab7ca07d53034@baidu.com> (raw)
In-Reply-To: <20210830170837-mutt-send-email-mst@kernel.org>
> -----邮件原件-----
> 发件人: Michael S. Tsirkin <mst@redhat.com>
> 发送时间: 2021年8月31日 5:10
> 收件人: Li,Rongqing <lirongqing@baidu.com>
> 抄送: netdev@vger.kernel.org; bpf@vger.kernel.org;
> virtualization@lists.linux-foundation.org
> 主题: Re: [PATCH] virtio_net: reduce raw_smp_processor_id() calling in
> virtnet_xdp_get_sq
>
> On Thu, Aug 26, 2021 at 04:21:35PM +0800, Li RongQing wrote:
> > smp_processor_id()/raw* will be called once each when not more queues
> > in virtnet_xdp_get_sq() which is called in non-preemptible context, so
> > it's safe to call the function
> > smp_processor_id() once.
> >
> > Signed-off-by: Li RongQing <lirongqing@baidu.com>
>
> commit log should probably explain why it's a good idea to replace
> raw_smp_processor_id with smp_processor_id in the case of curr_queue_pairs
> <= nr_cpu_ids.
>
I change it as below, is it ok?
virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq
smp_processor_id() and raw_smp_processor_id() are called once
each in virtnet_xdp_get_sq(), when curr_queue_pairs <= nr_cpu_ids,
should be merged
virtnet_xdp_get_sq() is called in non-preemptible context, so
it's safe to call the function smp_processor_id(), and keep
smp_processor_id(), and remove the calling of raw_smp_processor_id(),
avoid the wrong use virtnet_xdp_get_sq to preemptible context
in the future
-Li
next prev parent reply other threads:[~2021-08-31 2:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 8:21 [PATCH] virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq Li RongQing
2021-08-30 21:10 ` Michael S. Tsirkin
2021-08-31 2:09 ` Li,Rongqing [this message]
2021-08-31 14:33 ` 答复: " Michael S. Tsirkin
2021-09-03 4:00 ` 答复: " Li,Rongqing
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=bbf978c3252b4f2ea13ab7ca07d53034@baidu.com \
--to=lirongqing@baidu.com \
--cc=bpf@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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