Re: [RFC v2 2/5] Bluetooth: Minor optimization for multiple tx connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
> ---
>  net/bluetooth/hci_core.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 47a31fa..0defa83 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1826,7 +1826,7 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
>        }
>
>        if (conn) {
> -               int cnt, q;
> +               int cnt;
>
>                switch (conn->type) {
>                case ACL_LINK:
> @@ -1844,8 +1844,7 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
>                        BT_ERR("Unknown link type");
>                }
>
> -               q = cnt / num;
> -               *quote = q ? q : 1;
> +               *quote = (cnt + (num - 1)) / num;
>        } else
>                *quote = 0;
>
> --
> 1.7.4.1
>

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?


-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux