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: <20250613144133.GJ414686@horms.kernel.org>
Date: Fri, 13 Jun 2025 15:41:33 +0100
From: Simon Horman <horms@...nel.org>
To: John Ousterhout <ouster@...stanford.edu>
Cc: netdev@...r.kernel.org, pabeni@...hat.com, edumazet@...gle.com,
	kuba@...nel.org
Subject: Re: [PATCH net-next v9 13/15] net: homa: create homa_timer.c

On Mon, Jun 09, 2025 at 08:40:46AM -0700, John Ousterhout wrote:
> This file contains code that wakes up periodically to check for
> missing data, initiate retransmissions, and declare peer nodes
> "dead".
> 
> Signed-off-by: John Ousterhout <ouster@...stanford.edu>

...

> diff --git a/net/homa/homa_timer.c b/net/homa/homa_timer.c

...

> +/**
> + * homa_timer() - This function is invoked at regular intervals ("ticks")
> + * to implement retries and aborts for Homa.
> + * @homa:    Overall data about the Homa protocol implementation.
> + */
> +void homa_timer(struct homa *homa)
> +{
> +	struct homa_socktab_scan scan;
> +	struct homa_sock *hsk;
> +	struct homa_rpc *rpc;
> +	int total_rpcs = 0;

total_rpcs is set but otherwise unused in this function.
It looks like it can be removed.

Flagged by clang 20.1.4 as:

  net/homa/homa_timer.c:107:6: warning: variable 'total_rpcs' set but not used [-Wunused-but-set-variable]
    107 |         int total_rpcs = 0;
        |             ^

> +	int rpc_count = 0;
> +
> +	homa->timer_ticks++;
> +
> +	/* Scan all existing RPCs in all sockets. */
> +	for (hsk = homa_socktab_start_scan(homa->socktab, &scan);
> +			hsk; hsk = homa_socktab_next(&scan)) {
> +		while (hsk->dead_skbs >= homa->dead_buffs_limit)
> +			/* If we get here, it means that Homa isn't keeping
> +			 * up with RPC reaping, so we'll help out.  See
> +			 * "RPC Reaping Strategy" in homa_rpc_reap code for
> +			 * details.
> +			 */
> +			if (homa_rpc_reap(hsk, false) == 0)
> +				break;
> +
> +		if (list_empty(&hsk->active_rpcs) || hsk->shutdown)
> +			continue;
> +
> +		if (!homa_protect_rpcs(hsk))
> +			continue;
> +		rcu_read_lock();
> +		list_for_each_entry_rcu(rpc, &hsk->active_rpcs, active_links) {
> +			total_rpcs++;
> +			homa_rpc_lock(rpc);
> +			if (rpc->state == RPC_IN_SERVICE) {
> +				rpc->silent_ticks = 0;
> +				homa_rpc_unlock(rpc);
> +				continue;
> +			}
> +			rpc->silent_ticks++;
> +			homa_timer_check_rpc(rpc);
> +			homa_rpc_unlock(rpc);
> +			rpc_count++;
> +			if (rpc_count >= 10) {
> +				/* Give other kernel threads a chance to run
> +				 * on this core.
> +				 */
> +				rcu_read_unlock();
> +				schedule();
> +				rcu_read_lock();
> +				rpc_count = 0;
> +			}
> +		}
> +		rcu_read_unlock();
> +		homa_unprotect_rpcs(hsk);
> +	}
> +	homa_socktab_end_scan(&scan);
> +	homa_skb_release_pages(homa);
> +	homa_peer_gc(homa->peertab);
> +}
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ