public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: <davem@davemloft•net>, <netdev@vger•kernel.org>,
	<brouer@redhat•com>, <jpirko@redhat•com>, <jbrouer@redhat•com>
Subject: Re: [PATCH net v5 2/2] net: sched: htb: fix calculation of quantum
Date: Fri, 6 Dec 2013 10:36:26 +0800	[thread overview]
Message-ID: <52A1382A.6030504@huawei.com> (raw)
In-Reply-To: <1386245932.30495.169.camel@edumazet-glaptop2.roam.corp.google.com>

On 2013/12/5 20:18, Eric Dumazet wrote:
> On Thu, 2013-12-05 at 15:10 +0800, Yang Yingliang wrote:
>>  	if (!cl->level) {
>> -		cl->quantum = hopt->rate.rate / q->rate2quantum;
>> +		u64 quantum = div64_u64(cl->rate.rate_bytes_ps,
>> +					q->rate2quantum);
> 
> 		q->rate2quantum being 32bit, prefer the following :
> 
> 		u64 quantum = cl->rate.rate_bytes_ps;
> 
> 		do_div(quantum, q->rate2quantum);
> 
> 		Since it maps to better assembly code on 32bit arches.

Change it in v6, thanks!

Regards,
Yang

      reply	other threads:[~2013-12-06  2:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-05  7:10 [PATCH net v5 0/2] net: sched: fix some issues Yang Yingliang
2013-12-05  7:10 ` [PATCH net v5 1/2] net: sched: tbf: fix calculation of max_size Yang Yingliang
2013-12-05 12:15   ` Eric Dumazet
2013-12-06  2:24     ` Yang Yingliang
2013-12-06  3:46       ` Eric Dumazet
2013-12-06  3:57         ` Yang Yingliang
2013-12-05  7:10 ` [PATCH net v5 2/2] net: sched: htb: fix calculation of quantum Yang Yingliang
2013-12-05 12:18   ` Eric Dumazet
2013-12-06  2:36     ` Yang Yingliang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52A1382A.6030504@huawei.com \
    --to=yangyingliang@huawei$(echo .)com \
    --cc=brouer@redhat$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=jbrouer@redhat$(echo .)com \
    --cc=jpirko@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox