From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
umgwanakikbuti@gmail.com, mingo@elte.hu, ktkhai@parallels.com,
rostedt@goodmis.org, juri.lelli@gmail.com,
pang.xunlei@linaro.org, oleg@redhat.com,
wanpeng.li@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/9] hrtimer: Allow hrtimer::function() to free the timer
Date: Thu, 4 Jun 2015 07:59:30 +0200 [thread overview]
Message-ID: <20150604055930.GA13638@gmail.com> (raw)
In-Reply-To: <20150603212949.GD3644@twins.programming.kicks-ass.net>
* Peter Zijlstra <peterz@infradead.org> wrote:
> On Wed, Jun 03, 2015 at 07:41:43PM +0200, Thomas Gleixner wrote:
> > On Wed, 3 Jun 2015, Peter Zijlstra wrote:
> > > /**
> > > * struct hrtimer - the basic hrtimer structure
> > > @@ -153,6 +144,7 @@ struct hrtimer_clock_base {
> > > struct timerqueue_head active;
> > > ktime_t (*get_time)(void);
> > > ktime_t offset;
> > > + struct hrtimer *running;
> >
> > Aside of lacking a KernelDoc comment, it expands the struct size on
> > 32bit from 32 bytes to 36 bytes which undoes some of the recent cache
> > line optimizations I did. Mooo!
> >
> > So we might think about storing the running timer pointer in cpu_base
> > instead for 32bit, which increases the foot print of the migration
> > base and the extra cost for the additional indirection, but it would
> > keep cache line tight for the hot pathes.
>
> A wee something like this then?
>
> ---
> --- a/include/linux/hrtimer.h
> +++ b/include/linux/hrtimer.h
> @@ -123,8 +123,10 @@ struct hrtimer_sleeper {
>
> #ifdef CONFIG_64BIT
> # define HRTIMER_CLOCK_BASE_ALIGN 64
> +# define __timer_base_running(timer) timer->base->running
> #else
> # define HRTIMER_CLOCK_BASE_ALIGN 32
> +# define __timer_base_running(timer) timer->base->cpu_base->running
> #endif
Please put it into the cpu_base on 64-bit as well: the base pointer is available
already on 64-bit so there should be no measurable performance difference, and
readability is a primary concern with all this code.
Thanks,
Ingo
next prev parent reply other threads:[~2015-06-04 5:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 13:29 [PATCH 0/9] sched: balance callbacks Peter Zijlstra
2015-06-03 13:29 ` [PATCH 1/9] sched: Replace post_schedule with a balance callback list Peter Zijlstra
2015-06-03 13:29 ` [PATCH 2/9] sched: Use replace normalize_task() with __sched_setscheduler() Peter Zijlstra
2015-06-03 13:29 ` [PATCH 3/9] sched: Allow balance callbacks for check_class_changed() Peter Zijlstra
2015-06-03 13:29 ` [PATCH 4/9] sched,rt: Remove return value from pull_rt_task() Peter Zijlstra
2015-06-03 13:29 ` [PATCH 5/9] sched,rt: Convert switched_{from,to}_rt() / prio_changed_rt() to balance callbacks Peter Zijlstra
2015-06-03 13:29 ` [PATCH 6/9] sched,dl: Remove return value from pull_dl_task() Peter Zijlstra
2015-06-03 13:29 ` [PATCH 7/9] sched,dl: Convert switched_{from,to}_dl() / prio_changed_dl() to balance callbacks Peter Zijlstra
2015-06-03 13:29 ` [PATCH 8/9] hrtimer: Allow hrtimer::function() to free the timer Peter Zijlstra
2015-06-03 16:26 ` Kirill Tkhai
2015-06-03 21:13 ` Peter Zijlstra
2015-06-04 9:07 ` Kirill Tkhai
2015-06-04 10:49 ` Peter Zijlstra
2015-06-04 10:55 ` Peter Zijlstra
2015-06-04 10:58 ` Peter Zijlstra
2015-06-05 9:02 ` Kirill Tkhai
2015-06-05 9:03 ` Kirill Tkhai
2015-06-05 9:11 ` Peter Zijlstra
2015-06-05 9:10 ` Peter Zijlstra
2015-06-05 9:27 ` Kirill Tkhai
2015-06-03 17:41 ` Thomas Gleixner
2015-06-03 21:29 ` Peter Zijlstra
2015-06-04 5:59 ` Ingo Molnar [this message]
2015-06-04 10:07 ` Peter Zijlstra
2015-06-04 12:37 ` Ingo Molnar
2015-06-03 13:29 ` [PATCH 9/9] sched,dl: Fix sched class hopping CBS hole Peter Zijlstra
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=20150604055930.GA13638@gmail.com \
--to=mingo@kernel.org \
--cc=juri.lelli@gmail.com \
--cc=ktkhai@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=pang.xunlei@linaro.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=umgwanakikbuti@gmail.com \
--cc=wanpeng.li@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.