public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kobject: Always build in kernel/ksysfs.o.
@ 2008-01-31  9:12 Paul Mundt
  2008-01-31 17:03 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mundt @ 2008-01-31  9:12 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

kernel/ksysfs.c seems to be a random dumping group for misc globals
that the rest of the tree depend on. This has caused problems with
exports in the past when sysfs is disabled, which can already be
observed in commit-id 51107301b629640f9ab76fe23bf385e187b9ac29.

The latest one is the kernel_kobj usage, which presently results in:

fs/built-in.o: In function `debugfs_init':
inode.c:(.init.text+0xc34): undefined reference to `kernel_kobj'
make: *** [.tmp_vmlinux1] Error 1

kernel/ksysfs.c itself at this point only contains globals and some
basic sysfs initialization, the sysfs initialization code is optimized
out when we build with sysfs disabled. Given that, it's easier to just
build in unconditionally, rather than trying to find some other random
place to dump and initialize the globals.

Additionally, the current trend seems to be decoupling of kobjects from
sysfs, in which case it still makes sense to perform the kernel_kobj
initialization that happens here even if sysfs is disabled, as
lib/kobject.o is built-in unconditionally.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

---

 kernel/Makefile |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/Makefile b/kernel/Makefile
index 8885627..db9af70 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -9,7 +9,7 @@ obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
 	    rcupdate.o extable.o params.o posix-timers.o \
 	    kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
 	    hrtimer.o rwsem.o latency.o nsproxy.o srcu.o \
-	    utsname.o notifier.o
+	    utsname.o notifier.o ksysfs.o
 
 obj-$(CONFIG_SYSCTL) += sysctl_check.o
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
@@ -49,7 +49,6 @@ obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
 obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
 obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
 obj-$(CONFIG_KPROBES) += kprobes.o
-obj-$(CONFIG_SYSFS) += ksysfs.o
 obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
 obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
 obj-$(CONFIG_SECCOMP) += seccomp.o

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kobject: Always build in kernel/ksysfs.o.
  2008-01-31  9:12 [PATCH] kobject: Always build in kernel/ksysfs.o Paul Mundt
@ 2008-01-31 17:03 ` Greg KH
  2008-01-31 23:15   ` Paul Mundt
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2008-01-31 17:03 UTC (permalink / raw)
  To: Paul Mundt, linux-kernel

On Thu, Jan 31, 2008 at 06:12:34PM +0900, Paul Mundt wrote:
> kernel/ksysfs.c seems to be a random dumping group for misc globals
> that the rest of the tree depend on. This has caused problems with
> exports in the past when sysfs is disabled, which can already be
> observed in commit-id 51107301b629640f9ab76fe23bf385e187b9ac29.
> 
> The latest one is the kernel_kobj usage, which presently results in:
> 
> fs/built-in.o: In function `debugfs_init':
> inode.c:(.init.text+0xc34): undefined reference to `kernel_kobj'
> make: *** [.tmp_vmlinux1] Error 1
> 
> kernel/ksysfs.c itself at this point only contains globals and some
> basic sysfs initialization, the sysfs initialization code is optimized
> out when we build with sysfs disabled. Given that, it's easier to just
> build in unconditionally, rather than trying to find some other random
> place to dump and initialize the globals.
> 
> Additionally, the current trend seems to be decoupling of kobjects from
> sysfs, in which case it still makes sense to perform the kernel_kobj
> initialization that happens here even if sysfs is disabled, as
> lib/kobject.o is built-in unconditionally.
> 
> Signed-off-by: Paul Mundt <lethal@linux-sh.org>

I'll take this, it looks right, but I don't think it fixes the
kernel_kobj problem, that shows up in a number of other places too.  I'm
working on fixing that up properly right now, give me a day, I'm doing
builds with tons of different kernel options :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kobject: Always build in kernel/ksysfs.o.
  2008-01-31 17:03 ` Greg KH
@ 2008-01-31 23:15   ` Paul Mundt
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2008-01-31 23:15 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Thu, Jan 31, 2008 at 09:03:44AM -0800, Greg KH wrote:
> On Thu, Jan 31, 2008 at 06:12:34PM +0900, Paul Mundt wrote:
> > kernel/ksysfs.c seems to be a random dumping group for misc globals
> > that the rest of the tree depend on. This has caused problems with
> > exports in the past when sysfs is disabled, which can already be
> > observed in commit-id 51107301b629640f9ab76fe23bf385e187b9ac29.
> > 
> > The latest one is the kernel_kobj usage, which presently results in:
> > 
> > fs/built-in.o: In function `debugfs_init':
> > inode.c:(.init.text+0xc34): undefined reference to `kernel_kobj'
> > make: *** [.tmp_vmlinux1] Error 1
> > 
> > kernel/ksysfs.c itself at this point only contains globals and some
> > basic sysfs initialization, the sysfs initialization code is optimized
> > out when we build with sysfs disabled. Given that, it's easier to just
> > build in unconditionally, rather than trying to find some other random
> > place to dump and initialize the globals.
> > 
> > Additionally, the current trend seems to be decoupling of kobjects from
> > sysfs, in which case it still makes sense to perform the kernel_kobj
> > initialization that happens here even if sysfs is disabled, as
> > lib/kobject.o is built-in unconditionally.
> > 
> > Signed-off-by: Paul Mundt <lethal@linux-sh.org>
> 
> I'll take this, it looks right, but I don't think it fixes the
> kernel_kobj problem, that shows up in a number of other places too.  I'm
> working on fixing that up properly right now, give me a day, I'm doing
> builds with tons of different kernel options :)
> 
Thanks. At least it makes the link error go away, which is the only
kernel_kobj problem I had. If there's a greater conceptual problem with
kernel_kobj, that's out of scope for this patch, and I defer to you on
such matters ;-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-31 23:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-31  9:12 [PATCH] kobject: Always build in kernel/ksysfs.o Paul Mundt
2008-01-31 17:03 ` Greg KH
2008-01-31 23:15   ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox