[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191218095101.GQ2844@hirez.programming.kicks-ass.net>
Date: Wed, 18 Dec 2019 10:51:01 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Ming Lei <ming.lei@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Jens Axboe <axboe@...nel.dk>,
linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
Long Li <longli@...rosoft.com>, Ingo Molnar <mingo@...hat.com>,
Keith Busch <keith.busch@...el.com>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
John Garry <john.garry@...wei.com>,
Hannes Reinecke <hare@...e.com>
Subject: Re: [RFC PATCH 1/3] sched/core: add API for exporting runqueue clock
On Wed, Dec 18, 2019 at 03:19:40PM +0800, Ming Lei wrote:
> Scheduler runqueue maintains its own software clock that is periodically
> synchronised with hardware. Export this clock so that it can be used
> by interrupt flood detection for saving the cost of reading from hardware.
But you don't have much, if any, guarantees the thing gets updated.
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 90e4b00ace89..03e2e3c36067 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -219,6 +219,11 @@ void update_rq_clock(struct rq *rq)
> update_rq_clock_task(rq, delta);
> }
>
> +u64 sched_local_rq_clock(void)
> +{
> + return this_rq()->clock;
> +}
> +EXPORT_SYMBOL_GPL(sched_local_rq_clock);
Also, more NAK, you're exporting a variant of __rq_clock_broken().
(which, now that I git-grep for it, has become unused, good!)
Powered by blists - more mailing lists