From: Jens Axboe <axboe@kernel.dk>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>,
davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, pabeni@redhat.com,
bpf@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: Re: [GIT PULL] Networking for v6.9
Date: Tue, 12 Mar 2024 15:53:31 -0600 [thread overview]
Message-ID: <72921846-16d0-438f-a6b0-eef704542e6d@kernel.dk> (raw)
In-Reply-To: <20240312144806.5f9c5d8e@kernel.org>
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
next prev parent reply other threads:[~2024-03-12 21:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 4:25 [GIT PULL] Networking for v6.9 Jakub Kicinski
2024-03-12 20:17 ` Linus Torvalds
2024-03-12 20:34 ` Jakub Kicinski
2024-03-12 20:47 ` Jakub Kicinski
2024-03-12 21:11 ` Linus Torvalds
2024-03-12 21:40 ` Jens Axboe
2024-03-12 21:48 ` Jakub Kicinski
2024-03-12 21:53 ` Jens Axboe [this message]
2024-03-12 21:55 ` Jakub Kicinski
2024-03-12 22:02 ` Jens Axboe
2024-03-12 22:14 ` Tejun Heo
2024-03-12 22:24 ` Jakub Kicinski
2024-03-13 0:00 ` Jakub Kicinski
2024-03-13 1:00 ` Linus Torvalds
2024-03-13 1:10 ` pr-tracker-bot
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=72921846-16d0-438f-a6b0-eef704542e6d@kernel.dk \
--to=axboe@kernel.dk \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=johannes.thumshirn@wdc.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).