Hi Luiz, On Thu, 2011-08-18 at 03:49 -0400, Luiz Augusto von Dentz wrote: > Hi Peter, > > On Thu, Aug 18, 2011 at 3:37 AM, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> wrote: > > When assigning tx quotas for multiple connections, bump fractional > > amounts to the next higher integer. This can reduce the number of > > iterations through the tx scheduler. For example, if 5 avail acl > > buffers are to be used by 3 transmitting connections, the current > > scheduler will produce quotas of 1, 1, 1, 1, 1. This > > optimization will instead produce quotas of 2, 2, 1 (ie., 2 less > > iterations of the tx scheduler). > > > > Signed-off-by: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> ... <snip> ... > Nice catch, actually after seeing your patch I realize one of my > patches is wrong in assuming an HCI Channel can only be scheduled once > per tx_task, but I guess with your changes we can probably assume so, > right? Thanks. Yes, in the current scheduler a connection can be scheduled multiple times per tasklet run. For example, supposed that acl_cnt == 3 and 2 connections have packets in their queue. Let's assume for the sake of simplicity that no connections currently have unacked packets (c->sent == 0). Then (with the current scheduler), 1st iteration: conn list walked => conn A found (equal unacked) quote = 3/2 => 1 for conn A conn A now has 1 unacked packet (after send) 2nd iteration: conn list walked => conn B found (lowest unacked) quote = 2/2 => 1 for conn B conn B now has 1 unacked packet (after send) 3rd iteration: conn list walked => conn A found (equal unacked) quote = 1/2 => 1 for conn A conn A now has 2 unacked packets (after send) With the proposed change, only 2 iterations occur: 1st iteration: conn list walked => conn A found (equal unacked) quote = 3/2 => 2 for conn A conn A now has 2 unacked packets (after send) 2nd iteration: conn list walked => conn B found (lowest unacked) quote = 1/2 => 1 for conn B conn B now has 1 unacked packet (after send) However, even with this change it may be that connections are scheduled multiple times per tasklet. This can happen if a connection still has equal or fewer unacked packets even after spending it's quota. But I didn't see in your proposal where you assume that an HCI channel can only be scheduled once (or at least where it breaks down if true). Regards, Peter Hurley ��.n��������+%������w��{.n�����{����^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�