mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Swanson <swanson@ukfsn.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH][2.4] Miniscule block and kstat optimisation
Date: Tue, 20 Jan 2004 19:44:01 +0000	[thread overview]
Message-ID: <1074627841.31306.18.camel@zeus.local> (raw)


[-- 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 --]

                 reply	other threads:[~2004-01-20 19:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1074627841.31306.18.camel@zeus.local \
    --to=swanson@ukfsn.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®