Latest Linus git: kernel/sched.c:12

Previous thread: [PATCH] PCI: enable nv_msi_ht_cap_quirk for ALi bridges (2.6.24 regression) by Björn Krombholz on Sunday, May 11, 2008 - 3:24 pm. (2 messages)

Next thread: 2.6.25.1: Kernel BUG at mm/rmap.c:669, General Protection Faults, and generic hard locks by Randy Johnson on Sunday, May 11, 2008 - 5:21 pm. (1 message)
From: Kevin Winchester
Date: Sunday, May 11, 2008 - 4:55 pm

Hi Ingo,

I got the above warning in my latest build.  I assume it is because 
init_hrtick() is only called from CONFIG_SMP sched_init_smp(), and I 
have a HRT-enabled UP box.

I could write up the simple patch to put #ifdef CONFIG_SMP around 
init_hrtick(), but with all of the #ifdefs in that file, I figure it is 
probably a little more complicated than that.

Config below.

-- 
Kevin Winchester


#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.26-rc1
# Sun May 11 20:40:37 2008
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_DEFCONFIG_LIST="arch/x86/configs/x86_64_defconfig"
# CONFIG_GENERIC_LOCKBREAK is not set
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_FAST_CMPXCHG_LOCAL=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
# CONFIG_GENERIC_GPIO is not set
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_AOUT=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_X86_BIOS_REBOOT=y
CONFIG_X86_TRAMPOLINE=y
# CONFIG_KTIME_SCALAR is not set

#
# General ...
From: Ingo Molnar
Date: Tuesday, May 13, 2008 - 6:23 am

the fix seems simple - see below. The #ifdef jungle ... less so.

	Ingo

--------------->
Subject: sched: fix defined-but-unused warning
From: Rabin Vincent <rabin@rab.in>
Date: Sun, 11 May 2008 05:55:33 +0530

Fix this warning, which appears with !CONFIG_SMP:
kernel/sched.c:1216: warning: `init_hrtick' defined but not used

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/sched.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -1130,6 +1130,7 @@ static enum hrtimer_restart hrtick(struc
 	return HRTIMER_NORESTART;
 }
 
+#ifdef CONFIG_SMP
 static void hotplug_hrtick_disable(int cpu)
 {
 	struct rq *rq = cpu_rq(cpu);
@@ -1185,6 +1186,7 @@ static void init_hrtick(void)
 {
 	hotcpu_notifier(hotplug_hrtick, 0);
 }
+#endif /* CONFIG_SMP */
 
 static void init_rq_hrtick(struct rq *rq)
 {
--

From: Dhaval Giani
Date: Tuesday, May 13, 2008 - 8:34 am

I attempted to make it a bit easier to figure out that jungle at 
http://lkml.org/lkml/2008/5/12/64 , if it helps.

-- 
regards,
Dhaval
--

From: Ingo Molnar
Date: Tuesday, May 13, 2008 - 10:17 am

yeah, applied it - it definitely helps. Would be better to hide most of 
these complications in include files though.

	Ingo
--

From: Kevin Winchester
Date: Monday, May 26, 2008 - 4:04 pm

Did this ever make it to a pull request?  I still see the warning with 
latest git.

-- 
Kevin Winchester
--

From: Ingo Molnar
Date: Tuesday, June 17, 2008 - 1:37 am

it's queued up in tip/sched-devel at the moment:

 # sched-devel: 81d41d7: sched: fix defined-but-unused warning

but you are right, we can do this in v2.6.26 - i have cherry-picked it 
over into the v2.6.26 queue of patches.

	Ingo
--

Previous thread: [PATCH] PCI: enable nv_msi_ht_cap_quirk for ALi bridges (2.6.24 regression) by Björn Krombholz on Sunday, May 11, 2008 - 3:24 pm. (2 messages)

Next thread: 2.6.25.1: Kernel BUG at mm/rmap.c:669, General Protection Faults, and generic hard locks by Randy Johnson on Sunday, May 11, 2008 - 5:21 pm. (1 message)