[PATCH] CONFIG_BLK_STAT

From: Kurt Garloff (garloff@suse.de)
Date: Sun Jul 14 2002 - 11:01:42 EST


Hi Marcelo,

looking at the gendisk stuff, I noticed that we need quite some space to
collect statistics on a per partition basis.
On a 32bit arch, we have sizeof(struct hd_struct) = 68, if I don't misparse.
Which makes 17408 bytes kmalloced per disk major number. Which is not quite
large and also unfortunately just above a power of two where our slab
allocator will not be so efficient.
The latter can be fixed, the number field is not used anymore in the kernel
anywhere, as far as I could find. So I removed it, and we're back at 16384
bytes (on 32 bit archs), which is much nicer already.

For some cases, this still maybe much too much kernel memory just for
collecting statistics that may be interesting for a kernel hacker that does
some tuning on elevator ... but not for the normal user. After a couple of
hours uptime some of the 32bit counters overflow on a moderately loaded
machine (my desktop) anyway :-(
Think of having 8 SCSI majors and a few IDE ones to get a feeling for the
amount of wasted memory.
Or think even more than 128 SCSI disks (I'm working on that ... and we will
allocate stuff all dynamically there)

So I made them a config option. CONFIG_BLK_STAT
We did not have the per part statisics in /proc/partitions until recently,
anyway, so I doubt many people depend on them. And the memory footprint of
the hd_struct per major is back to 3072 bytes then (32bit arch again).

Patch is against 2.4.19rc1 and I'd like to see it in 2.4.19.

Comments?

-- 
Kurt Garloff                   <kurt@garloff.de>         [Eindhoven, NL]
Physics: Plasma simulations    <K.Garloff@TUE.NL>     [TU Eindhoven, NL]
Linux: SCSI, Security          <garloff@suse.de>    [SuSE Nuernberg, DE]
 (See mail header or public key servers for PGP2 and GPG public keys.)



- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:27 EST