On Mon, Aug 24, 2009 at 07:48:51PM +0300, Yossi Etigin wrote:
> Are you suggesting to sort the list each time we have add/remove a new entry,
> or search for the correct location to insert the new entry? I'm afraid that
> would add too much complexity and be inefficient (in O() terms).
1) This is an unlikely failure path 2) It is only O(n) to insert a
entry into the proper place in an already sorted linked list. 3) I
think you can do it about four lines of code.
list_for_each_entry_reverse(i,priv->multicast_list,list) {
if (i->xx < mcast->xx || priv->multicast_list == i) {
list_move(mcast->list,i->list);
break;
}
}
Which is actually O(1) in the most common cases.
> Moreover, I believe that moving a failed mcast entry to the end of
> the list behaves the same as always joining the least-backoff-value
> mcast entry (since everybody start with the same backoff).
Nope.. New entries can be added at any time which unsorts things.
Jason
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general