lkml.org 
[lkml]   [2021]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] net-sysfs: Slightly optimize 'xps_queue_show()'
On Sun, Nov 21, 2021 at 2:38 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> The 'mask' bitmap is local to this function. So the non-atomic
> '__set_bit()' can be used to save a few cycles.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> net/core/net-sysfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
> index 9c01c642cf9e..3be3f4a6add3 100644
> --- a/net/core/net-sysfs.c
> +++ b/net/core/net-sysfs.c
> @@ -1452,7 +1452,7 @@ static ssize_t xps_queue_show(struct net_device *dev, unsigned int index,
>
> for (i = map->len; i--;) {
> if (map->queues[i] == index) {
> - set_bit(j, mask);
> + __set_bit(j, mask);
> break;
> }
> }
> --
> 2.30.2
>
The similar optimization can seem to be done in br_vlan.c and br_if.c as well.

\
 
 \ /
  Last update: 2021-11-22 16:24    [W:0.045 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site