[lustre-devel] [PATCH 20/34] lnet: discard ni_cpt_list

NeilBrown neilb at suse.com
Tue Sep 11 22:48:24 PDT 2018


On Wed, Sep 12 2018, Doug Oucharek wrote:

> I'm assuming that a future patch will be chaining the NI structure on to the NET structure it belongs to.  This patch is just not chaining the NIs on a global NIS list anymore.  As such, ni_cptlist is being "repurposed".

The NI is already chained onto the NET through
 lnet_net.net_ni_list and lnet_ni.ni_netlist

ni_cptlist is not used even in current master.
It is never added to any list, but lnet_ni_unlink_locked() does remove
it from a list.  Is that code wrong (should be checking ni_netlist), or
is it cruft that should be removed?

Thanks,
NeilBrown

>
> Reviewed-by: Doug Oucharek <dougso at me.com>
>
> Doug
>
> On 9/6/18, 5:54 PM, "NeilBrown" <neilb at suse.com> wrote:
>
>     This isn't used any more.
>     The new comment is odd - this is no net_ni_cpt !!
>     The ni_cptlist linkage is no longer used - should it go too?
>     
>     This is part of
>         8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
>            LU-7734 lnet: Multi-Rail local NI split
>     
>     Signed-off-by: NeilBrown <neilb at suse.com>
>     ---
>      .../staging/lustre/include/linux/lnet/lib-types.h  |    4 +---
>      drivers/staging/lustre/lnet/lnet/api-ni.c          |    7 -------
>      2 files changed, 1 insertion(+), 10 deletions(-)
>     
>     diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
>     index 6c34ecf22021..dc15fa75a9d2 100644
>     --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
>     +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
>     @@ -305,7 +305,7 @@ struct lnet_net {
>      struct lnet_ni {
>      	/* chain on the lnet_net structure */
>      	struct list_head	  ni_netlist;
>     -	/* chain on ln_nis_cpt */
>     +	/* chain on net_ni_cpt */
>      	struct list_head	ni_cptlist;
>      
>      	spinlock_t		ni_lock;
>     @@ -671,8 +671,6 @@ struct lnet {
>      
>      	/* LND instances */
>      	struct list_head		ln_nets;
>     -	/* NIs bond on specific CPT(s) */
>     -	struct list_head		ln_nis_cpt;
>      	/* the loopback NI */
>      	struct lnet_ni			*ln_loni;
>      	/* network zombie list */
>     diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
>     index 546d5101360f..960f235df5e7 100644
>     --- a/drivers/staging/lustre/lnet/lnet/api-ni.c
>     +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
>     @@ -538,7 +538,6 @@ lnet_prepare(lnet_pid_t requested_pid)
>      
>      	INIT_LIST_HEAD(&the_lnet.ln_test_peers);
>      	INIT_LIST_HEAD(&the_lnet.ln_nets);
>     -	INIT_LIST_HEAD(&the_lnet.ln_nis_cpt);
>      	INIT_LIST_HEAD(&the_lnet.ln_routers);
>      	INIT_LIST_HEAD(&the_lnet.ln_drop_rules);
>      	INIT_LIST_HEAD(&the_lnet.ln_delay_rules);
>     @@ -616,7 +615,6 @@ lnet_unprepare(void)
>      	LASSERT(!the_lnet.ln_refcount);
>      	LASSERT(list_empty(&the_lnet.ln_test_peers));
>      	LASSERT(list_empty(&the_lnet.ln_nets));
>     -	LASSERT(list_empty(&the_lnet.ln_nis_cpt));
>      
>      	lnet_portals_destroy();
>      
>     @@ -1294,11 +1292,6 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_lnd_tunables *tun)
>      	/* refcount for ln_nis */
>      	lnet_ni_addref_locked(ni, 0);
>      	list_add_tail(&ni->ni_net->net_list, &the_lnet.ln_nets);
>     -	if (ni->ni_cpts) {
>     -		lnet_ni_addref_locked(ni, 0);
>     -		list_add_tail(&ni->ni_cptlist, &the_lnet.ln_nis_cpt);
>     -	}
>     -
>      	lnet_net_unlock(LNET_LOCK_EX);
>      
>      	ni->ni_state = LNET_NI_STATE_ACTIVE;
>     
>     
>     
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20180912/cdd72e86/attachment.sig>


More information about the lustre-devel mailing list