Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kconfig STOP_MACHINE goofiness, 2.6.39+
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Tue Jan 24, 2012 11:36 pm    Post subject: Kconfig STOP_MACHINE goofiness, 2.6.39+ Reply with quote

I am getting this warning message from "make menuconfig"
(or "make oldconfig") when configuring kernels from 2.6.39
to 3.1.6 (newest one that I have tried):
Code:

warning: (HAVE_TEXT_POKE_SMP) selects STOP_MACHINE which has
unmet direct dependencies (SMP && MODULE_UNLOAD || HOTPLUG_CPU)


Platform: amd athon64 x2

The correct processor family and smp are selected in the kernel .config.
The system board does not support cpu hotplug, so that is not enabled.
I am not using loadable modules, so loadable module support is not enabled.

The only Kconfig file in the kernel source where HAVE_TEXT_POKE_SMP appears
is under CONFIG_X86 in arch/x86/Kconfig. I am guessing that CONFIG_X86_64
selects CONFIG_X86 and whatever Kconfig options it selects that are not excluded
by some other condition not being met.

I have tried disabling a lot of kernel .config options which might be triggering
this warning, but so far only disabling smp has worked. (Not a reasonable
solution to the problem.)

How else can I get rid of this inane dependence of STOP_MACHINE on loadable
module support or cpu hotplug? (It was not there in vanilla-sources-2.6.38.8,
which is the latest kernel that I configured where I did not get the warning.
It is there in gentoo-sources-2.6.39-r4.)

Any ideas?
_________________
TIA
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Wed Jan 25, 2012 2:54 am    Post subject: Reply with quote

You can enable CPU hotplug in software even if it is not supported by your hardware. On systems that support suspend-to-disk, CPU hotplug is forcibly enabled, because the hibernation code uses it to disable non-boot CPUs during creation of the hibernation image.
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Wed Jan 25, 2012 3:48 am    Post subject: Reply with quote

Ok, thanks.

It is not so much that it is doing unreasonable things with
text_poke_smp() or stop_machine et al. They are used either
in early boot code or debugging code like kprobes to
patch jump targets, etc, in the running kernel.
(See arch/x86/kernel/alternative.c, arch/x86/include/asm/fixmap.h,
and kernel/stop_machine.c.) The #ifdef CONFIG_HOTPLUG_CPU
sections are just there for necessary locking if cpus can come
and go while these functions run.

It is just that the code seems to mash the _init and module
load/unload cases together so that it won't need separate
functions or a bunch of #ifdef/#endif blocks if loadable modules
are not enabled.

I was hoping it was only a Kconfig silliness, listing a
dependency that it was not really dependent on in the
actual code.

"Everyone using smp uses loadable modules."

Wrong assumption.
_________________
TIA
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Wed Jan 25, 2012 4:40 am    Post subject: Reply with quote

Indeed. I have systems that are SMP and yet have MODULES=n.
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Thu Jan 26, 2012 5:39 am    Post subject: Reply with quote

So, setting CONFIG_HOTPLUG_CPU=y in the kernel 3.1.6 .config
worked. I did not need to enable loadable modules as well. I got
no warnings from menuconfig, the kernel compiled ok, and
it is now running. (There is evidence of an ACPI bug in BIOS
related to plug-n-play, but having the kernel probe and then
disable that at boot is only a noisy log entry in dmesg.)

I still find the "loadable modules *or* cpu hotplug" dependency
of STOP_MACHINE in Kconfig suspicious. By what stretch of the
imagination are those two alternative implementations of the
same functionality? Likely they share a side-effect that the functions
enabled by STOP_MACHINE rely on that should be factored out
into a common implementation of something that any subsystem
can use (imho).
_________________
TIA
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Fri Jan 27, 2012 12:44 pm    Post subject: Reply with quote

Kconfig could have an option called CONFIG_STRICT_TXT_LOCK
which is what STOP_MACHINE wants to keep threads running on other
cpus from stepping on its toes when the caller of its functions
needs to change something in the kernel code. SMP and loadable
modules would both automatically select it and depend on it.
Hotplug cpu would depend on it. STOP_MACHINE would depend on it.
Kprobes et al could select it and depend on it. HAVE_TXT_POKE_SMP
would depend on it. The jump labels stuff would depend on it.

Then there is only the one Kconfig dependency there for these
different kernel config options that need that same funtionality.
The only way to find it not selected in contexts where it is
needed is to alter the .config file with a text editor.

(More explicit and less "kernel gestalt voodoo" Kconfig depencies
makes it easier for users configuring kernels to understand the warnings,
Kconfig files, and so on.)
_________________
TIA
Back to top
View user's profile Send private message
libertytrek
Apprentice
Apprentice


Joined: 18 Jul 2007
Posts: 258

PostPosted: Tue Mar 19, 2013 12:37 pm    Post subject: Reply with quote

Hello,

Ok, I just noticed this warning when configuring a new kernel, and am unsure of what I should do - if anything...

My system is just like OPs - dual AMD64, motherboard doesn't have hotplug support, and I have loadable modules disable...

So... what should I do about this warning? Can it be safely ignored? Or should I enable CPU Hotplug?

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum