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]
Date: Tue, 12 Mar 2024 15:53:31 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
 Johannes Thumshirn <johannes.thumshirn@....com>, davem@...emloft.net,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org, pabeni@...hat.com,
 bpf@...r.kernel.org, Tejun Heo <tj@...nel.org>
Subject: Re: [GIT PULL] Networking for v6.9

On 3/12/24 3:48 PM, Jakub Kicinski wrote:
> On Tue, 12 Mar 2024 15:40:07 -0600 Jens Axboe wrote:
>> Hmm, I wonder if the below will fix it. At least from the timer side,
>> we should not be using the cached clock.
>>
>>
>> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
>> index 9a85bfbbc45a..646b50e1c914 100644
>> --- a/block/blk-iocost.c
>> +++ b/block/blk-iocost.c
>> @@ -1044,7 +1044,7 @@ static void ioc_now(struct ioc *ioc, struct ioc_now *now)
>>  	unsigned seq;
>>  	u64 vrate;
>>  
>> -	now->now_ns = blk_time_get_ns();
>> +	now->now_ns = ktime_get_ns();
>>  	now->now = ktime_to_us(now->now_ns);
>>  	vrate = atomic64_read(&ioc->vtime_rate);
> 
> Let me try this, 'cause doing the revert while listening to some
> meeting is beyond me :)

Thanks! I think the better fix is probably the one below. I pondered
adding a WARN_ON_ONCE() here, but I think just checking for in_task
state is probably the saner way forward, just in case... But I strongly
suspect the previous one should sort it for you.


diff --git a/block/blk.h b/block/blk.h
index a19b7b42e650..5cac4e29ae17 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -534,7 +534,7 @@ static inline u64 blk_time_get_ns(void)
 {
 	struct blk_plug *plug = current->plug;
 
-	if (!plug)
+	if (!plug || !in_task())
 		return ktime_get_ns();
 
 	/*

-- 
Jens Axboe


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ