From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Cheng Renquan (程任全)" <crquan@gmail.com>
Cc: "Arjan van de Ven" <arjan@linux.intel.com>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Matt Helsley" <matthltc@us.ibm.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Adrian Bunk" <bunk@kernel.org>,
"Ananth N Mavinakayanahalli" <ananth@in.ibm.com>,
anil.s.keshavamurthy@intel.com, davem@davemloft.net,
mhiramat@redhat.com, linux-kernel@vger.kernel.org,
Pavel Machek <pavel@suse.cz>
Subject: Re: KPROBE linking error (who's the maintainer of kernel/power/) ?
Date: Mon, 5 Jan 2009 14:16:03 +0100 [thread overview]
Message-ID: <200901051416.04816.rjw@sisk.pl> (raw)
In-Reply-To: <91b13c310901042312o44afa166t66b23e8ad10d104f@mail.gmail.com>
Hi,
On Monday 05 January 2009, Cheng Renquan (程任全) wrote:
> with this .config
>
> CONFIG_CGROUPS=y
> CONFIG_CGROUP_FREEZER=y
> CONFIG_MODULES=y
> CONFIG_FREEZER=y
> CONFIG_PM=y
> CONFIG_PM_SLEEP=n
>
> the kernel will end compiling with error:
>
> kernel/built-in.o: In function `check_safety':
> /usr/src/linux-2.6.28/kernel/kprobes.c:126: undefined reference to
> `freeze_processes'
> /usr/src/linux-2.6.28/kernel/kprobes.c:139: undefined reference to
> `thaw_processes'
> /usr/src/linux-2.6.28/kernel/kprobes.c:139: undefined reference to
> `thaw_processes'
> make: *** [.tmp_vmlinux1] Error 1
So there is a bug, thanks for the report.
> By read kernel/kprobes.c, I found there maybe a bug:
>
> 1. "check_safety" in "kernel/kprobes.c" call thaw_processes if both
> CONFIG_PREEMPT and CONFIG_PM defined,
> 2. "thaw_processes" function is implemented in "kernel/power/process.c",
> 3. but it is only used if CONFIG_FREEZER defined, from <linux/freezer.h>,
> 4. else (CONFIG_FREEZER undefined) it's a null macro defined in
> <linux/freezer.h>,
> 5. but process.o only get compile if CONFIG_PM_SLEEP defined, from
> "kernel/power/Makefile",
>
> Now I'm confused on how to resolve this?
I'd make process.o depend on CONFIG_FREEZER (patch below).
> What's the relation of PM, PM_SLEEP, and FREEZER?
PM_SLEEP depends on PM and FREEZER is defined in kernel/Kconfig.freezer as
config FREEZER
def_bool PM_SLEEP || CGROUP_FREEZER
> Which modification of the following will be better?
> 1. modify kernel/Kconfig, let KPROBES depends more?
> 2. modify kernel/kprobes.c, let the conditional compile depends more?
> 3. modify include/linux/freezer.h, move thaw_processes to include/linux/pm.h?
> 4. modify kernel/power/Makefile, let kernel/power/process.c compile on
> less condition?
>
> Furthermore, there seems no entry for maintainers of "kernel/power/",
> who maintain that subdir please add your name to the MAINTAINERS file?
> I just grab some latest touchers of kernel/power/ and kernel/kprobes.c
> as the recipients here.
I'm one of the maintainers.
Thanks,
Rafael
---
Subject: PM: Fix freezer compilation if PM_SLEEP is unset
From: Rafael J. Wysocki <rjw@sisk.pl>
Freezer fails to compile if with the following configuration
settings:
CONFIG_CGROUPS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_MODULES=y
CONFIG_FREEZER=y
CONFIG_PM=y
CONFIG_PM_SLEEP=n
Fix this by making process.o compilation depend on CONFIG_FREEZER.
Reported-by: Cheng Renquan <crquan@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
kernel/power/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-2.6/kernel/power/Makefile
===================================================================
--- linux-2.6.orig/kernel/power/Makefile
+++ linux-2.6/kernel/power/Makefile
@@ -4,7 +4,8 @@ EXTRA_CFLAGS += -DDEBUG
endif
obj-y := main.o
-obj-$(CONFIG_PM_SLEEP) += process.o console.o
+obj-$(CONFIG_PM_SLEEP) += console.o
+obj-$(CONFIG_FREEZER) += process.o
obj-$(CONFIG_HIBERNATION) += swsusp.o disk.o snapshot.o swap.o user.o
obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o
next prev parent reply other threads:[~2009-01-05 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 7:12 Cheng Renquan (程任全)
2009-01-05 13:16 ` Rafael J. Wysocki [this message]
2009-01-05 16:55 ` Cheng Renquan (程任全)
2009-01-05 19:51 ` Rafael J. Wysocki
2009-01-05 22:11 ` [PATCH] kprobes: check CONFIG_FREEZER instead of CONFIG_PM Masami Hiramatsu
2009-01-06 8:48 ` KPROBE linking error (who's the maintainer of kernel/power/) ? Pavel Machek
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=200901051416.04816.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=arjan@linux.intel.com \
--cc=bunk@kernel.org \
--cc=crquan@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=matthltc@us.ibm.com \
--cc=mhiramat@redhat.com \
--cc=pavel@suse.cz \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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
Powered by JetHome