All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: linan666@huaweicloud.com
Cc: josef@toxicpanda.com, axboe@kernel.dk, yukuai3@huawei.com,
	cgroups@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, linan122@huawei.com,
	yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH] blk-throttle: Calculate allowed value only when the throttle is enabled
Date: Wed, 4 Oct 2023 09:31:38 -1000	[thread overview]
Message-ID: <ZR29mvoQMxcZcppw@slm.duckdns.org> (raw)
In-Reply-To: <20230928015858.1809934-1-linan666@huaweicloud.com>

Hello,

On Thu, Sep 28, 2023 at 09:58:58AM +0800, linan666@huaweicloud.com wrote:
> From: Li Nan <linan122@huawei.com>
> 
> When the throttle of bps is not enabled, tg_bps_limit() returns U64_MAX,
> which is be used in calculate_bytes_allowed(), and divide 0 error will
> happen.

calculate_bytes_allowed() is just

  return mul_u64_u64_div_u64(bps_limit, (u64)jiffy_elapsed, (u64)HZ); 

The only division is by HZ. How does divide by 0 happen?

Thanks.

-- 
tejun

  reply	other threads:[~2023-10-04 19:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  1:58 [PATCH] blk-throttle: Calculate allowed value only when the throttle is enabled linan666
2023-10-04 19:31 ` Tejun Heo [this message]
2023-10-04 20:30   ` Khazhy Kumykov
2023-10-04 20:44 ` Khazhy Kumykov
     [not found]   ` <4ace01e8-6815-29d0-70ce-4632818ca701@huaweicloud.com>
2023-10-05 16:24     ` Oleg Nesterov
2023-10-07  1:23       ` Yu Kuai
2023-10-07 15:16         ` Oleg Nesterov
2023-10-08  1:26           ` Yu Kuai
2023-10-08 11:36             ` Oleg Nesterov
2023-10-13 21:51               ` Khazhy Kumykov
2023-10-16  1:46                 ` Yu Kuai
2023-10-16 20:06                   ` Khazhy Kumykov
2023-10-16 21:48                     ` Khazhy Kumykov
2023-10-17  2:38                     ` Yu Kuai
2023-10-05 17:04     ` Oleg Nesterov
2023-10-05 17:15       ` Khazhy Kumykov

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=ZR29mvoQMxcZcppw@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=houtao1@huawei.com \
    --cc=josef@toxicpanda.com \
    --cc=linan122@huawei.com \
    --cc=linan666@huaweicloud.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.