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: <0959d3c2-b849-4826-8edf-d72a89fbadff@acm.org>
Date: Thu, 5 Jun 2025 08:13:53 +0800
From: Bart Van Assche <bvanassche@....org>
To: Yury Norov <yury.norov@...il.com>, Hannes Reinecke <hare@...e.de>,
 "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
 "Martin K. Petersen" <martin.petersen@...cle.com>,
 linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi/fcoe: simplify fcoe_select_cpu()

On 6/5/25 7:42 AM, Yury Norov wrote:
> diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
> index b911fdb387f3..07eddafe52ff 100644
> --- a/drivers/scsi/fcoe/fcoe.c
> +++ b/drivers/scsi/fcoe/fcoe.c
> @@ -1312,10 +1312,7 @@ static inline unsigned int fcoe_select_cpu(void)
>   {
>   	static unsigned int selected_cpu;
>   
> -	selected_cpu = cpumask_next(selected_cpu, cpu_online_mask);
> -	if (selected_cpu >= nr_cpu_ids)
> -		selected_cpu = cpumask_first(cpu_online_mask);
> -
> +	selected_cpu = cpumask_next_wrap(selected_cpu, cpu_online_mask);
>   	return selected_cpu;
>   }

Why does this algorithm occur in the FCoE driver? Isn't
WORK_CPU_UNBOUND good enough for this driver? And if it isn't
good enough, shouldn't this kind of functionality be integrated in
kernel/workqueue.c rather than having the above algorithm in a
kernel driver?

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ