public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Arjan van de Ven <arjan@infradead.org>,
	linux-kernel@vger.kernel.org, lenb@kernel.org, mingo@elte.hu,
	yanmin_zhang@linux.intel.com, torvalds@linux-foundation.org,
	jens.axboe@oracle.com, David Howells <dhowells@redhat.com>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Subject: Re: PATCH] cpuidle: A new variant of the menu governor to boost IO performance
Date: Mon, 14 Sep 2009 10:15:28 +0200	[thread overview]
Message-ID: <1252916128.5699.41.camel@laptop> (raw)
In-Reply-To: <4AADF8FE.1060208@kernel.org>

On Mon, 2009-09-14 at 17:04 +0900, Tejun Heo wrote:
> Andrew Morton wrote:
> > This fails to compile in linux-next:
> > 
> > drivers/cpuidle/governors/menu-tng.o:(.discard+0x0): multiple definition of `__pcpu_unique_menu_devices'
> > drivers/cpuidle/governors/menu.o:(.discard+0x0): first defined here
> > 
> > because we have
> > 
> > static DEFINE_PER_CPU(struct menu_device, menu_devices);
> > 
> > in both menu.c and menu-tng.c.
> > 
> > Despite the `static', the percpu changes in
> > 
> > commit 7c756e6e19e71f0327760d8955f7077118ebb2b1
> > Author:     Tejun Heo <tj@kernel.org>
> > AuthorDate: Wed Jun 24 15:13:50 2009 +0900
> > Commit:     Tejun Heo <tj@kernel.org>
> > CommitDate: Wed Jun 24 15:13:50 2009 +0900
> > 
> >     percpu: implement optional weak percpu definitions
> > 
> > are emitting global symbol derived from `menu_devices' and they clash.
> > 
> > I'll rename menu_devices to fix that up, but we have a problem...
> 
> Unfortunately, this was the only way we could come up with to get
> alpha and s390 working with the new percpu allocator.  On other archs,
> the global definition isn't necessary but config option
> DEBUG_FORCE_WEAK_PER_CPU enables it so that alpha and s390 don't choke
> on generic code later.
> 
> The core of the problem is that the memory model used by gcc on those
> two archs assume that static symbols are reachable with small offset
> but percpu variables, static or not, always end up way away.  Making
> all percpu variables weak and using global symbols to enforce global
> uniqueness works around the problem but with the side effect you're
> seeing.
> 
> If someone has any better ideas, I would happy to remove the annoying
> restriction.

That sounds like a variable __attribute__((no-explicit-relocs)) should
be proposed to the GCC folks or something. Then we can at least have a
hope of lifting this restriction some time in the future.

(Alternatively we build the full alpha kernel with
--mno-explicit-relocs, but that would be sub-optimal as well)

Not sure if s390 has anything similar..

Alternatively we could file it as a bug, since the symbols are in a
custom .section, which is a strong indication we're going to play funny
games anyway.


  reply	other threads:[~2009-09-14  8:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 15:40 PATCH] cpuidle: A new variant of the menu governor to boost IO performance Arjan van de Ven
2009-09-11 16:37 ` Jens Axboe
2009-09-11 19:16 ` John Stoffel
2009-09-11 19:51   ` Arjan van de Ven
2009-09-14  3:30   ` Zhang, Yanmin
2009-09-11 22:03 ` Matthew Garrett
2009-09-12  3:26   ` Arjan van de Ven
2009-09-12 11:39     ` Matthew Garrett
2009-09-12 14:04       ` Arjan van de Ven
2009-09-13 23:30 ` Andrew Morton
2009-09-14  2:45   ` Arjan van de Ven
2009-09-14  7:43 ` Andrew Morton
2009-09-14  8:04   ` Tejun Heo
2009-09-14  8:15     ` Peter Zijlstra [this message]
2009-09-14  9:09       ` Tejun Heo
2009-09-14 20:31   ` Arjan van de Ven

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=1252916128.5699.41.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jens.axboe@oracle.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=yanmin_zhang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox