> -----Original Message----- > From: Ying Xue [mailto:ying....@windriver.com] > Sent: Tuesday, 13 December, 2016 07:39 > To: Jon Maloy <jon.ma...@ericsson.com>; tipc-discussion@lists.sourceforge.net; > Parthasarathy Bhuvaragan <parthasarathy.bhuvara...@ericsson.com> > Cc: ma...@donjonn.com; thompa....@gmail.com > Subject: Re: [net-next v3 3/3] tipc: reduce risk of user starvation during > link > congestion > > On 12/13/2016 06:42 AM, Jon Maloy wrote: > > void link_prepare_wakeup(struct tipc_link *l) > > { > > - int pnd[TIPC_SYSTEM_IMPORTANCE + 1] = {0,}; > > - int imp, lim; > > struct sk_buff *skb, *tmp; > > + int imp, i = 0; > > > > skb_queue_walk_safe(&l->wakeupq, skb, tmp) { > > imp = TIPC_SKB_CB(skb)->chain_imp; > > - lim = l->backlog[imp].limit; > > - pnd[imp] += TIPC_SKB_CB(skb)->chain_sz; > > - if ((pnd[imp] + l->backlog[imp].len) >= lim) > > + if (l->backlog[imp].len < l->backlog[imp].limit) { > > + skb_unlink(skb, &l->wakeupq); > > + skb_queue_tail(l->inputq, skb); > > + } else if (i++ > 10) { > > About wakeup skb number, probably we can make it smarter, for example, > its value can be decided by link window size and the size of available > backlog queue or something else. As the value is an important factor for > us, I suggest it's worth considering more.
Sure we can make it smarter, but I don't see why you see this figure as important. This is just an "emergency brake" in case the wakeup queue is very long. If we have failed to find a user to wake up more than ten times it is very likely that all relevant levels are congested, and it is meaningless and a waste of CPU to continue. Note that the iterator is NOT stepped when we find a user to wake up. Regards ///jon > > Regards, > Ying > > > > break; > > - skb_unlink(skb, &l->wakeupq); > > - skb_queue_tail(l->inputq, skb); > > + } > > } > > } ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ tipc-discussion mailing list tipc-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tipc-discussion