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] [day] [month] [year] [list]
Date: Tue, 6 Jun 2023 12:10:51 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Stefan Roesch <shr@...kernel.io>
Cc: io-uring@...r.kernel.org, kernel-team@...com, axboe@...nel.dk,
	ammarfaizi2@...weeb.org, netdev@...r.kernel.org, kuba@...nel.org,
	olivier@...llion01.com
Subject: Re: [PATCH v14 2/8] net: introduce napi_busy_loop_rcu()

On Mon, Jun 05, 2023 at 02:20:03PM -0700, Stefan Roesch wrote:
> This introduces the napi_busy_loop_rcu() function. If the caller of
> napi_busy_loop() function is also taking the rcu read lock, it is possible
> that napi_busy_loop() is releasing the read lock if it invokes schedule.
> However the caller is expecting that the rcu read lock is not released
> until the function completes. This new function avoids that problem. It
> expects that the caller MUST hold the rcu_read_lock while calling this
> function.
> 
> Signed-off-by: Stefan Roesch <shr@...kernel.io>

Hi Stefan,

some minor nits from my side, which you may
want to consider if you need to spin a v15 for some reason.

...

> diff --git a/net/core/dev.c b/net/core/dev.c
> index f4677aa20f84..fcd4a6a70646 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6213,6 +6213,37 @@ static inline void __napi_busy_poll(struct napi_busy_poll_ctx *ctx,
>  				LINUX_MIB_BUSYPOLLRXPACKETS, work);
>  	local_bh_enable();
>  }
> +
> +/*
> + * Warning: can exit without calling need_resched().
> + */

For historical reasons, multi-line comments in Networking code are like
this.

/* Something
 * more
 */

Though I notice that dev.c doesn't follow this too closely,
perhaps for other historical reasons.

Anyway, in this case I'd suggest a single like comment.
Unless there is something more to say.

/* Warning: can exit without calling need_resched(). */

> +void napi_busy_loop_rcu(unsigned int napi_id,
> +		    bool (*loop_end)(void *, unsigned long),
> +		    void *loop_end_arg, bool prefer_busy_poll, u16 budget)

The indentation of the above two likes should align with the inside
of the opening parentheses.

void napi_busy_loop_rcu(unsigned int napi_id,
			bool (*loop_end)(void *, unsigned long),
			void *loop_end_arg, bool prefer_busy_poll, u16 budget)

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ