lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8473fca2-16ab-b2a6-ede7-d1449aa7d463@huaweicloud.com>
Date: Tue, 25 Feb 2025 10:07:06 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Ming Lei <ming.lei@...hat.com>, Yu Kuai <yukuai1@...weicloud.com>
Cc: tj@...nel.org, josef@...icpanda.com, axboe@...nel.dk,
 cgroups@...r.kernel.org, linux-block@...r.kernel.org,
 linux-kernel@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com,
 "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH 2/2] blk-throttle: fix off-by-one jiffies wait_time

Hi,

在 2025/02/25 9:24, Ming Lei 写道:
>> -       if (!time_elapsed)
>> +       /* don't trim slice until at least 2 slice is used */
>> +       if (time_elapsed < tg->td->throtl_slice * 2)
>>                  return;
> 
> If you just want to fix throtl/001, the above patch might
> work(sometimes, it might not, and timer may expire by 2 jiffies), but it
> is easy to fail other tests, such as, reduce the bps limit a bit, and
> increase BS a bit to make the IO cross exactly two slices.

That's fine, the key point is the following code, above code is
just to make sure there is still at least one slice to trim after
removing the last slice.

+       /* dispite the last slice, trim previous slice */
+       time_elapsed -= tg->td->throtl_slice;

In this case, if one BIO cross 1+ slices, the rate is the same as
expected in the previous slices, we can trim them without any negative
impact.

Thanks,
Kuai

> 
> Also the big question is that how you can make sure that rate is always
> good when the window is >= 2 slice?
> 
> 
> Thanks,
> Ming
> 
> 
> .
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ