linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Kernel thoughts of a Linux user
@ 2004-11-18 17:59 Gerold J. Wucherpfennig
  2004-11-18 18:50 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Gerold J. Wucherpfennig @ 2004-11-18 17:59 UTC (permalink / raw)
  To: linux-kernel

- setting up kernel boot parameters with graphical tools is unreliable, 
because the system doesn't know which bootloader entry was chosen.
One solution to this issue is to create a new kernel parameter "loaderhint"
where the bootloader will be able to set the number of the chosen boot entry.
In the configuration file of the bootloader this will have to be explicitly 
remarked e.g. ... loaderhint=%selection% ... . Unfortunately this could be
circumvented, because it isn't mandatory and could be manipulated in the boot 
loader configuration. (Other/better suggestions are welcome)

-speed up the booting process and make the system more reliable and
secure by skipping to autoprobe all devices. Instead initialize only the
devices which were set up at the last system startup. The data can be given
by kernel parameters or there could be established a more convenient
mechanism. This data will be stored automatically when the system startup
is completed (by some shell script etc.) There will be a kernel mechanism to
tell userspace about available, but unconfigured, unprobed devices (sysfs?)
and a mechanism to set up each device separately. There has to be a fallback
mechanism which lets the kernel boot with full probing like it is done today,
of course. (Other/better suggestions are welcome).

- The above mentioned ideas will pave the way to some sort of device manager
which can enable/disable devices, initialize new devices and store all those
settings across system reboots as it has never been possible in the UNIX/Linux
world before

- Make sysfs optional and enable to publish kernel <-> userspace data
especially the kernel's KObject data across the kernel's netlink interface as
it has been summarized on www.kerneltrap.org. This will avoid the
deadlocks sysfs does introduce when some userspace app holds an open file
handle of an sysfs object (KObject) which is to be removed. An importrant side 
effect for embedded systems will be that the RAM overhead introduced by sysfs
will vaporize.

- Replace DRI with sth. slimmer and intoduce real kernel drivers
and introduce real kernel drivers which handel all the initialization and 
interrupt handling (only minimal hardware abstraction). One goal is to
remove X.org's PCI magic. Ultimately this shall give framebuffer and X
the same basis. This was summarized on kerneltrap.org.


I hope this thoughts will be helpful to someone and may lead to a discussion
which will lead to code which resolves some deficiencies of Linux systems
(compared to features of some other prominent operating system).

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Kernel thoughts of a Linux user
@ 2004-11-20 10:31 Gerold J. Wucherpfennig
  2004-11-21 18:29 ` Greg KH
  0 siblings, 1 reply; 30+ messages in thread
From: Gerold J. Wucherpfennig @ 2004-11-20 10:31 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

> On Thu, Nov 18, 2004 at 06:59:27PM +0100, Gerold J. Wucherpfennig wrote:
> > 
> > - Make sysfs optional and enable to publish kernel <-> userspace data
> > especially the kernel's KObject data across the kernel's netlink interface 
as
> > it has been summarized on www.kerneltrap.org. This will avoid the
> > deadlocks sysfs does introduce when some userspace app holds an open file
> > handle of an sysfs object (KObject) which is to be removed. An importrant 
side 
> > effect for embedded systems will be that the RAM overhead introduced by 
sysfs
> > will vaporize.
> 
> What RAM overhead?  With 2.6.10-rc2 the memory footprint of sysfs has
> been drasticly shrunk.

Sorry I my kernel knowledge only consists of kerneltrap.org news :-(
I didn't knew that.
 
> 
> What deadlocks are you referring to?
> 


I don't know if it are deadlocks, please read last years article from lwn:
http://lwn.net/Articles/36850/


> And the netlink interface for hotplug events is already present in the
> latest kernel.

I don't know much about netlink. But sysfs --> libsysfs --> hal --> dbus
seems to be a lot of an overhead. Maybe create an in-kernel queue
for hardware information requests and publish the hardware information
with netlink would be a little less overhead??? Just a though...


^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Kernel thoughts of a Linux user
@ 2004-11-22  9:54 Adam J. Richter
  0 siblings, 0 replies; 30+ messages in thread
From: Adam J. Richter @ 2004-11-22  9:54 UTC (permalink / raw)
  To: gjwucherpfennig, greg; +Cc: linux-kernel

On 2004-11-18 18:50:11, Greg KH wrote:
>On Thu, Nov 18, 2004 at 06:59:27PM +0100, Gerold J. Wucherpfennig wrote:
>> 
>> - Make sysfs optional and enable to publish kernel <-> userspace data
>> especially the kernel's KObject data across the kernel's netlink interface as
>> it has been summarized on www.kerneltrap.org. This will avoid the
>> deadlocks sysfs does introduce when some userspace app holds an open file
>> handle of an sysfs object (KObject) which is to be removed. An importrant side 
>> effect for embedded systems will be that the RAM overhead introduced by sysfs
>> will vaporize.
>
>What RAM overhead?  With 2.6.10-rc2 the memory footprint of sysfs has
>been drasticly shrunk.

	Looking through 2.6.10-rc2-bk6/fs/sysfs/, it appears to me that
sysfs unswappable memory usage for this desktop system with two
hard disks and a couple of USB devices attached is over 600kB, even
if I do not count the underlying attribute or kobject structures that
are being registered in sysfs.

	Please correct me if I am wrong, but, as far as I can tell,
in 2.6.10-rc2-bk6, a struct dentry is held for each node in the sysfs
tree at all times.  I infer this from noticing that sysfs_drop_dentry
and sysfs_hash_and_remove in fs/sysfs/inode.c only seem to be called
on operations to delete a node.  If I've missed something and the dentry
structures are all or mostly released, I would love to be corrected about
it as that would be really good news to me.

	Here is a partial tally of what I believe are the bytes used for
each sysfs file in the old and new versions (using sizes on my 32-bit
x86 box; your sizes may vary depending on architecture and file system
options that you've enabled).

				Old		New
	dentry			144		144
	inode			344		---
	sysfs_dirent		---		 36
	
	Total			488		180

	There is also an underlying struct attribute (12 bytes) for
sysfs files and struct kobject (52 bytes for sysfs directories), but
let's assume that all of those would still be useful without sysfs.

	The desktop computer on which I am writing this email has
3405 nodes.  So, it's pinned memory consumption has presumbably
dropped from over 1.6 megabytes in the old version to something
over 600kB.

	This is a huge improvement _over the old memory consumption_,
and may also mark the point where most of the rest of the memory
shrink could come from outside of sysfs (for example, by splitting
struct dentry into the part that virtual file systems want to
keep and the part that is only useful when the VFS layer wants
to hold the dentry, or perhaps by making struct dentry and
struct kobject use the same name string), but I would not look at
600kB and say "What RAM overhead?"

	Am I missing something?  Are the dentries being freed
dynamically (for nodes that have not been deleted) in sysfs
in version 2.6.10-rc2-bk6?

                    __     ______________ 
Adam J. Richter        \ /
adam@yggdrasil.com      | g g d r a s i l

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Kernel thoughts of a Linux user
@ 2004-11-22 14:54 Adam J. Richter
  2004-11-22 20:21 ` Maneesh Soni
  0 siblings, 1 reply; 30+ messages in thread
From: Adam J. Richter @ 2004-11-22 14:54 UTC (permalink / raw)
  To: gjwucherpfennig, greg; +Cc: linux-kernel

I wrote:
>        Please correct me if I am wrong, but, as far as I can tell,
>in 2.6.10-rc2-bk6, a struct dentry is held for each node in the sysfs
>tree at all times.  I infer this from noticing that sysfs_drop_dentry
>and sysfs_hash_and_remove in fs/sysfs/inode.c only seem to be called
>on operations to delete a node.  If I've missed something and the dentry
>structures are all or mostly released, I would love to be corrected about
>it as that would be really good news to me.

	I should correct myself, although this correction suggests
that sysfs currently uses slightly _more_ memory than I previously
thought in the case of my computer (1100 directories and 2305
non-directories in sysfs).

	In 2.6.10-rc2-bk6, it looks like sysfs releases the dname
structures as well in the case of a file (attribute) or symlink,
but keeps these structures *and* a struct inode for every directory
(kobject).  So, it looks like the non-swappable memory usage of my
/sys is actually about 900kB.

			directories		non-directories
	dentry		144			0
	inode		344			0
	sysfs_dirent	36			36

	Bytes per:	524			36
	#of nodes:	1100			2305
	Subtotal:	576,400			82,980

	Total:		659,380 bytes


	Perhaps the code that allows non-directories in sysfs to free
their inode and dname structures will in the future be extended to allow
directories do so also, which would reduce that total to 122kB.
However, even then, one might still consider how much of the 57kB of
kobject's and 36kB of attribute's and pointers to them in kset's
are due soley to sysfs, and therefore still consider it a RAM
overhead worth avoiding in some cases.

                    __     ______________ 
Adam J. Richter        \ /
adam@yggdrasil.com      | g g d r a s i l

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Kernel thoughts of a Linux user
@ 2004-11-22 15:32 Adam J. Richter
  0 siblings, 0 replies; 30+ messages in thread
From: Adam J. Richter @ 2004-11-22 15:32 UTC (permalink / raw)
  To: gjwucherpfennig, greg; +Cc: linux-kernel

I wrote:
>[...] So, it looks like the non-swappable memory usage of my
>/sys is actually about 900kB.

That number should be 659kB, as is show in the calculation that
followed it.  I somehow forgot to put in the correct figure before
I posted.  Sorry for any confusion that might have caused.

                    __     ______________ 
Adam J. Richter        \ /
adam@yggdrasil.com      | g g d r a s i l

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Kernel thoughts of a Linux user
@ 2004-12-14 18:02 Jan Engelhardt
  0 siblings, 0 replies; 30+ messages in thread
From: Jan Engelhardt @ 2004-12-14 18:02 UTC (permalink / raw)
  To: linux-kernel

>>>>So they could make themselves a favor and run something like seti@home.
>>>
>>>That does consume more energy than just sitting at idle.  I've seen some
>>>estimates of how much it costs to run seti 24/7 rather than just sit idle, 
>>>and the price was something like $80/year.
>>
>> For CPUs which don't have some sort of speedstep, it does not matter.
>> (Please correct me if I am wrong. It might be that HLT cycles are still 
>> more power-conservative even without speedstep than 24/7 on the FPU.)
>
>You're wrong :)
>Nowadays the power consumption of a CPU is more than the rest of the
>machine altogether (including hard disks, etc.).
>
>On my P4 2.8GHz HT CPU, I've measured the power consumed by *the entire
>computer* more than doubling as the processor went from idle into 100%
>load.
>
>Of course, this doesn't include a monster 3D card, is it could very well
>consume something close to the processor when doing a lot of 3D operations.

I have got a power measure device from university and experimented myself.
I keep it short: running SETI (in constrast to nothing, i.e. HLT insns),
only costs me 17 more Watts. With a price of 6 cent per kWh, this makes 
roughly 5.54 EUR per year when the machine is on 16h/340days.

(The theoretical case of 24/365 would make up 8.91 EUR.)

Wait, did not Intel pull back some processors because of their enormous heat 
of some P4 (which melted some)? Well, I guess *there* is all your $$ going.


Jan Engelhardt
-- 
ENOSPC

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

end of thread, other threads:[~2004-12-14 18:05 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-18 17:59 Kernel thoughts of a Linux user Gerold J. Wucherpfennig
2004-11-18 18:50 ` Greg KH
2004-11-18 20:00 ` Tomas Carnecky
2004-11-18 20:46   ` Jan Engelhardt
2004-11-18 20:52     ` Tomas Carnecky
2004-11-18 21:05       ` Jan Engelhardt
2004-11-18 21:15     ` Chris Friesen
2004-11-18 21:17       ` Jan Engelhardt
2004-11-18 21:29         ` Chris Friesen
2004-11-19 12:02         ` Paulo Marques
2004-11-19 12:05           ` Jan Engelhardt
2004-11-20  2:14           ` Alan Cox
2004-11-22  8:07   ` Helge Hafting
2004-11-22  8:38     ` Jan Engelhardt
2004-11-24 10:23       ` Helge Hafting
2004-11-22 11:17     ` Tomas Carnecky
2004-11-24 10:20       ` Helge Hafting
2004-11-24 11:31         ` Tomas Carnecky
2004-11-28 19:10           ` Helge Hafting
2004-11-19  5:04 ` H. Peter Anvin
2004-11-20 10:31 Gerold J. Wucherpfennig
2004-11-21 18:29 ` Greg KH
2004-11-22 21:33   ` Gerold J. Wucherpfennig
2004-11-22 18:40     ` Greg KH
2004-11-22 18:52     ` Måns Rullgård
2004-11-22  9:54 Adam J. Richter
2004-11-22 14:54 Adam J. Richter
2004-11-22 20:21 ` Maneesh Soni
2004-11-22 15:32 Adam J. Richter
2004-12-14 18:02 Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).