* [PATCH][2.4] Miniscule block and kstat optimisation
@ 2004-01-20 19:44 Alan Swanson
0 siblings, 0 replies; only message in thread
From: Alan Swanson @ 2004-01-20 19:44 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 433 bytes --]
Involving a (very) tiny speed-up in ll_rw_blk, by shifting the
calculation to proc, and saving memory from a now unused array.
It's basically a very small subset of my diskio patch for /proc/stat in
the 2.4 kernel.
Can someone pass this to Marcelo as there are no real maintainers for
the files touched. I've tried submitting directly but without response.
--
Alan.
"One must never be purposelessnessnesslessness."
[-- Attachment #1.2: kstat.diff --]
[-- Type: text/x-patch, Size: 2142 bytes --]
diff -ur linux-2.4.23-pre3/drivers/block/ll_rw_blk.c linux-2.4.23-pre3-kstat/drivers/block/ll_rw_blk.c
--- linux-2.4.23-pre3/drivers/block/ll_rw_blk.c 2003-11-28 21:27:25.000000000 +0000
+++ linux-2.4.23-pre3-kstat/drivers/block/ll_rw_blk.c 2003-12-31 15:52:48.000000000 +0000
@@ -701,7 +701,6 @@
if ((index >= DK_MAX_DISK) || (major >= DK_MAX_MAJOR))
return;
- kstat.dk_drive[major][index] += new_io;
if (rw == READ) {
kstat.dk_drive_rio[major][index] += new_io;
kstat.dk_drive_rblk[major][index] += nr_sectors;
diff -ur linux-2.4.23-pre3/fs/proc/proc_misc.c linux-2.4.23-pre3-kstat/fs/proc/proc_misc.c
--- linux-2.4.23-pre3/fs/proc/proc_misc.c 2003-11-28 21:27:28.000000000 +0000
+++ linux-2.4.23-pre3-kstat/fs/proc/proc_misc.c 2003-12-31 15:52:48.000000000 +0000
@@ -357,14 +357,16 @@
for (major = 0; major < DK_MAX_MAJOR; major++) {
for (disk = 0; disk < DK_MAX_DISK; disk++) {
- int active = kstat.dk_drive[major][disk] +
+ int active = kstat.dk_drive_rio[major][disk] +
+ kstat.dk_drive_wio[major][disk] +
kstat.dk_drive_rblk[major][disk] +
kstat.dk_drive_wblk[major][disk];
if (active)
proc_sprintf(page, &off, &len,
"(%u,%u):(%u,%u,%u,%u,%u) ",
major, disk,
- kstat.dk_drive[major][disk],
+ kstat.dk_drive_rio[major][disk] +
+ kstat.dk_drive_wio[major][disk],
kstat.dk_drive_rio[major][disk],
kstat.dk_drive_rblk[major][disk],
kstat.dk_drive_wio[major][disk],
diff -ur linux-2.4.23-pre3/include/linux/kernel_stat.h linux-2.4.23-pre3-kstat/include/linux/kernel_stat.h
--- linux-2.4.23-pre3/include/linux/kernel_stat.h 2003-06-13 22:15:13.000000000 +0100
+++ linux-2.4.23-pre3-kstat/include/linux/kernel_stat.h 2003-12-31 15:52:48.000000000 +0000
@@ -19,7 +19,6 @@
unsigned int per_cpu_user[NR_CPUS],
per_cpu_nice[NR_CPUS],
per_cpu_system[NR_CPUS];
- unsigned int dk_drive[DK_MAX_MAJOR][DK_MAX_DISK];
unsigned int dk_drive_rio[DK_MAX_MAJOR][DK_MAX_DISK];
unsigned int dk_drive_wio[DK_MAX_MAJOR][DK_MAX_DISK];
unsigned int dk_drive_rblk[DK_MAX_MAJOR][DK_MAX_DISK];
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-01-20 19:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20 19:44 [PATCH][2.4] Miniscule block and kstat optimisation Alan Swanson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®