[ofa-general] Re: [PATCH for-2.6.22] IB/cm: improve local id allocation

Michael S. Tsirkin mst at dev.mellanox.co.il
Mon May 21 07:54:36 PDT 2007


> Quoting Roland Dreier <rdreier at cisco.com>:
> Subject: Re: [PATCH for-2.6.22] IB/cm: improve local id allocation
> 
>  > IB/cm uses idr for local id allocations, with a running counter
>  > as start_id. This fails to generate distinct ids in the scenario where
>  > 1. An id is constantly created and destroyed
>  > 2. A chunk of ids just beyond the current next_id value is occupied
>  > 
>  > This in turn leads to an increased chance of connection request being mis-detected
>  > as a duplicate, sometimes for several retries, until next_id gets past
>  > the block of allocated ids. This has been observed in practice.
>  > 
>  > As a fix, remember the last id allocated and start immediately above it.
> 
> OK I guess but this needs some explanation about why the impact is so
> severe we want to merge it after rc2 is already out.

Well, it's a single-liner, so it seemed safe.
The impact currently is that CM times out, we re-create
a connection, either the applicatin aborts, or this process repeats 
until we get a good id, which can take a couple of minutes.

>  > +			next_id = (unsigned)id + 1;
> 
> what happens when this wraps and becomes negative?
> 
> in fact the idr stuff all works with plain signed ints -- could
> idr_get_new() ever give a negative id?  (too lazy too look at the
> source right now)

Good point, I'll check.

-- 
MST



More information about the general mailing list