mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzju@redhat.com>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: He Zhe <zhe.he@windriver.com>,
	anna-maria@linutronix.de, linux-kernel@vger.kernel.org,
	tglx@linutronix.de
Subject: Re: [PATCH] timers: Fix get_next_timer_interrupt() with no timers pending
Date: Fri, 16 Jul 2021 18:38:37 +0200	[thread overview]
Message-ID: <95fb6503b1513cff1df54a043d9e3df530ddd63a.camel@redhat.com> (raw)
In-Reply-To: <20210710005243.GA23956@lothringen>

On Sat, 2021-07-10 at 02:52 +0200, Frederic Weisbecker wrote:
> I guess later we can turn this .timers_pending into
> .timers_count and that would spare us the costly call to
> __next_timer_interrupt() up to the last level after the last
> timer is dequeued.

I've been looking into this. AFAIU there is no limit to the number of timers
one might enqueue, so there is no fool proof way of selecting .timers_count's
size. That said, 'struct timer_list' size is 40 bytes (as per pahole), so in
order to overflow an u32 .timers_count you'd need to allocate ~160GB in 'struct
timer_list' which I think is safe to assume will never happen.

Also, I measured the costy call to __next_timer_interrupt() it's slightly less
than 1us on my test machine. Not a that big in the grand scheme of things, but
it's in the irq exit code path, so I think it's worth the extra complexity in
the timer code.

Any thoughs?

-- 
Nicolás Sáenz


  parent reply	other threads:[~2021-07-16 16:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 15:16 [PATCH v2] timers: Recalculate next timer interrupt only when necessary Frederic Weisbecker
2020-07-24 10:59 ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2021-07-08  6:43 ` [PATCH v2] " He Zhe
2021-07-08 11:35   ` Frederic Weisbecker
2021-07-08 15:36   ` Frederic Weisbecker
2021-07-09  5:37     ` He Zhe
2021-07-09  8:43       ` Frederic Weisbecker
2021-07-09  9:25         ` He Zhe
2021-07-09 14:06           ` Nicolas Saenz Julienne
2021-07-09 14:13             ` [PATCH] timers: Fix get_next_timer_interrupt() with no timers pending Nicolas Saenz Julienne
2021-07-10  0:52               ` Frederic Weisbecker
2021-07-12 10:19                 ` Nicolas Saenz Julienne
2021-07-16 16:38                 ` Nicolas Saenz Julienne [this message]
2021-07-19 13:54                   ` Frederic Weisbecker
2021-07-10  9:05               ` Frederic Weisbecker
2021-07-12  6:04                 ` He Zhe

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=95fb6503b1513cff1df54a043d9e3df530ddd63a.camel@redhat.com \
    --to=nsaenzju@redhat.com \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zhe.he@windriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®