Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755164AbZINIQZ (ORCPT ); Mon, 14 Sep 2009 04:16:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752581AbZINIQY (ORCPT ); Mon, 14 Sep 2009 04:16:24 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:40636 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbZINIQX (ORCPT ); Mon, 14 Sep 2009 04:16:23 -0400 Subject: Re: PATCH] cpuidle: A new variant of the menu governor to boost IO performance From: Peter Zijlstra To: Tejun Heo Cc: Andrew Morton , Arjan van de Ven , 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 , Ivan Kokshaysky In-Reply-To: <4AADF8FE.1060208@kernel.org> References: <20090911174019.1ed02737@infradead.org> <20090914004301.105196cc.akpm@linux-foundation.org> <4AADF8FE.1060208@kernel.org> Content-Type: text/plain Date: Mon, 14 Sep 2009 10:15:28 +0200 Message-Id: <1252916128.5699.41.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2455 Lines: 61 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 > > AuthorDate: Wed Jun 24 15:13:50 2009 +0900 > > Commit: Tejun Heo > > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/