All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 0/3] nohz: Convert tick dependency mask to atomic_t
Date: Tue, 29 Mar 2016 11:44:54 +0200	[thread overview]
Message-ID: <20160329094454.GA4715@gmail.com> (raw)
In-Reply-To: <20160325131732.GA16488@lerouge>


* Frederic Weisbecker <fweisbec@gmail.com> wrote:

> On Fri, Mar 25, 2016 at 09:48:47AM +0100, Ingo Molnar wrote:
> > 
> > * Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > 
> > > As per Linus suggestion, lets convert the tick dependency mask to
> > > atomic_t. Introduce atomic_fetch_or() and confine fetch_or() back to
> > > scheduler guts.
> > > 
> > > git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
> > > 	timers/nohz
> > > 
> > > HEAD: 7b7e5da5733f58668181077ec394a718e08c392c
> > > 
> > > Thanks,
> > > 	Frederic
> > > ---
> > > 
> > > Frederic Weisbecker (3):
> > >       atomic: Introduce atomic_fetch_or
> > >       nohz: Convert tick dependency mask to atomic_t
> > >       Revert "atomic: Export fetch_or()"
> > > 
> > > 
> > >  include/linux/atomic.h   | 34 +++++++++++++--------------
> > >  include/linux/sched.h    |  4 ++--
> > >  kernel/sched/core.c      | 18 ++++++++++++++
> > >  kernel/time/tick-sched.c | 61 ++++++++++++++++++++++++------------------------
> > >  kernel/time/tick-sched.h |  2 +-
> > >  5 files changed, 68 insertions(+), 51 deletions(-)
> > 
> > Could you please also convert the sched/core.c usage, so that we can get rid of 
> > the private fetch_or() definition? Please also double check that it does not 
> > result in worse code generation.
> 
> That involve converting thread_info::flags to atomic_t and given how much the type varies
> across architectures:

Ah, yes - I did a similar analysis originally and then promptly forgot about it!

Harmonizing thread_info::flags does not look easy, given how much assembly code 
accesses this field.

So I suspect your original series of introducing the atomic_t interface while 
reverting back to the scheduler-specific auto-typing hack is fine after all.

> also given how much it is accessed (and that happens a lot in ASM as well). This 
> conversion deserves quite a whole project on its own.
> 
> It might be possible to do it incrementally though.

So I don't even know where to begin with that:

 - some 64-bit architectures want 32-bit flags
 - some 64-bit architectures want 64-bit flags
 - some 64-bit architectures may genuinely want more than 32 flags
 - some 64-bit architectures may want 64-bit word just because it's the fastest

... there's not a single natural data type on the C side that I can see this could 
be converted to :-/

Thanks,

	Ingo

  reply	other threads:[~2016-03-29  9:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 14:37 [PATCH 0/3] nohz: Convert tick dependency mask to atomic_t Frederic Weisbecker
2016-03-24 14:37 ` [PATCH 1/3] atomic: Introduce atomic_fetch_or Frederic Weisbecker
2016-03-29 10:36   ` [tip:core/urgent] locking/atomic: Introduce atomic_fetch_or() tip-bot for Frederic Weisbecker
2016-03-24 14:38 ` [PATCH 2/3] nohz: Convert tick dependency mask to atomic_t Frederic Weisbecker
2016-03-25  8:52   ` Ingo Molnar
2016-03-25 14:56     ` Frederic Weisbecker
2016-03-29 10:37   ` [tip:core/urgent] timers/nohz: " tip-bot for Frederic Weisbecker
2016-03-24 14:38 ` [PATCH 3/3] Revert "atomic: Export fetch_or()" Frederic Weisbecker
2016-03-29 10:37   ` [tip:core/urgent] locking/atomic, sched: Unexport fetch_or() tip-bot for Frederic Weisbecker
2016-03-25  8:48 ` [PATCH 0/3] nohz: Convert tick dependency mask to atomic_t Ingo Molnar
2016-03-25 13:17   ` Frederic Weisbecker
2016-03-29  9:44     ` Ingo Molnar [this message]
2016-03-29 12:23       ` Linus Torvalds
2016-03-29 12:59         ` Ingo Molnar
2016-03-29 13:05           ` Ingo Molnar
2016-03-29 13:08             ` Frederic Weisbecker
2016-03-31  6:54               ` Ingo Molnar
2016-03-31  9:20                 ` Peter Zijlstra
2016-03-31 13:18                   ` Ingo Molnar
2016-03-29 13:14             ` Ingo Molnar

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=20160329094454.GA4715@gmail.com \
    --to=mingo@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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 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.