lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bbf978c3252b4f2ea13ab7ca07d53034@baidu.com>
Date:   Tue, 31 Aug 2021 02:09:36 +0000
From:   "Li,Rongqing" <lirongqing@...du.com>
To:     "Michael S. Tsirkin" <mst@...hat.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>
Subject: 答复: [PATCH] virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq

> -----邮件原件-----
> 发件人: Michael S. Tsirkin <mst@...hat.com>
> 发送时间: 2021年8月31日 5:10
> 收件人: Li,Rongqing <lirongqing@...du.com>
> 抄送: netdev@...r.kernel.org; bpf@...r.kernel.org;
> virtualization@...ts.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@...du.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ