public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Christoph Rohland <cr@sap.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@redhat.com>
Subject: Re: [patch] zero-bounce block highmem I/O, #13
Date: Tue, 28 Aug 2001 13:41:41 +0200	[thread overview]
Message-ID: <20010828134141.M642@suse.de> (raw)
In-Reply-To: <20010827123700.B1092@suse.de> <m3itf85vlr.fsf@linux.local> <20010828125520.L642@suse.de>
In-Reply-To: <20010828125520.L642@suse.de>

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

On Tue, Aug 28 2001, Jens Axboe wrote:
> On Tue, Aug 28 2001, Christoph Rohland wrote:
> > Hi Jens,
> > 
> > I tested both #11 and #13 on my 8GB machine with sym53c8xx. The
> > initialization of a SAP DB database takes 20 minutes with 2.4.9 and
> > with 2.4.9+b13 it took nearly 2.5 hours :-(
> 
> DaveM hinted that it's probably the bounce test failing, so it's
> bouncing all the time. That would explain the much worse performance.
> Could you try with this incremental patch on top of b13 for 2.4.9? I
> still want to see the boot detection info, btw.
> 
> THanks!

Ok found the bug -- SCSI was accidentally using blk_seg_merge_ok when it
just wanted to test if we were crossing a 4GB physical address boundary
or not. Doh! Attached incremental patch should fix the SCSI performance
issue. I'm testing right now...

-- 
Jens Axboe


[-- Attachment #2: block-highmem-all-13-any-2 --]
[-- Type: text/plain, Size: 4174 bytes --]

diff -ur --exclude-from /home/axboe/exclude /opt/kernel/linux-2.4.9/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- /opt/kernel/linux-2.4.9/arch/i386/kernel/setup.c	Wed Jul 11 18:31:44 2001
+++ linux/arch/i386/kernel/setup.c	Mon Aug 27 15:03:14 2001
@@ -152,6 +152,8 @@
 static int disable_x86_serial_nr __initdata = 1;
 static int disable_x86_fxsr __initdata = 0;
 
+unsigned long max_pfn;
+
 /*
  * This is set up by the setup-routine at boot-time
  */
@@ -768,7 +770,7 @@
 void __init setup_arch(char **cmdline_p)
 {
 	unsigned long bootmap_size, low_mem_size;
-	unsigned long start_pfn, max_pfn, max_low_pfn;
+	unsigned long start_pfn, max_low_pfn;
 	int i;
 
 #ifdef CONFIG_VISWS
diff -ur --exclude-from /home/axboe/exclude /opt/kernel/linux-2.4.9/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- /opt/kernel/linux-2.4.9/drivers/block/ll_rw_blk.c	Tue Aug 28 12:51:56 2001
+++ linux/drivers/block/ll_rw_blk.c	Tue Aug 28 13:26:33 2001
@@ -125,7 +125,7 @@
  */
 static int queue_nr_requests, batch_requests;
 
-unsigned long blk_max_low_pfn;
+unsigned long blk_max_low_pfn, blk_max_pfn;
 
 static inline int get_max_sectors(kdev_t dev)
 {
@@ -292,8 +292,7 @@
 	if (!BH_CONTIG(bh, nxt))
 		return 0;
 
-	if ((bh_phys(bh) | 0xffffffff) ==
-	    ((bh_phys(nxt) + nxt->b_size - 1) | 0xffffffff))
+	if (BH_PHYS_4G(bh, nxt))
 		return 1;
 
 	return 0;
@@ -1207,6 +1206,7 @@
 	printk("block: %d slots per queue, batch=%d\n", queue_nr_requests, batch_requests);
 
 	blk_max_low_pfn = max_low_pfn;
+	blk_max_pfn = max_pfn;
 
 #ifdef CONFIG_AMIGA_Z2RAM
 	z2_init();
@@ -1328,4 +1328,5 @@
 EXPORT_SYMBOL(generic_unplug_device);
 EXPORT_SYMBOL(blk_queue_bounce_limit);
 EXPORT_SYMBOL(blk_max_low_pfn);
+EXPORT_SYMBOL(blk_max_pfn);
 EXPORT_SYMBOL(blk_seg_merge_ok);
diff -ur --exclude-from /home/axboe/exclude /opt/kernel/linux-2.4.9/drivers/scsi/scsi_merge.c linux/drivers/scsi/scsi_merge.c
--- /opt/kernel/linux-2.4.9/drivers/scsi/scsi_merge.c	Tue Aug 28 12:51:56 2001
+++ linux/drivers/scsi/scsi_merge.c	Tue Aug 28 13:35:07 2001
@@ -417,7 +417,7 @@
 
 	if ((req->nr_sectors + (bh->b_size >> 9)) > SHpnt->max_sectors)
 		return 0;
-	else if (!blk_seg_merge_ok(q, req->bhtail, bh))
+	else if (!BH_PHYS_4G(req->bhtail, bh))
 		return 0;
 
 	if (use_clustering) {
@@ -475,7 +475,7 @@
 
 	if ((req->nr_sectors + (bh->b_size >> 9)) > SHpnt->max_sectors)
 		return 0;
-	else if (!blk_seg_merge_ok(q, bh, req->bh))
+	else if (!BH_PHYS_4G(bh, req->bh))
 		return 0;
 
 	if (use_clustering) {
@@ -610,7 +610,7 @@
 	SDpnt = (Scsi_Device *) q->queuedata;
 	SHpnt = SDpnt->host;
 
-	if (!blk_seg_merge_ok(q, req->bhtail, next->bh))
+	if (!BH_PHYS_4G(req->bhtail, next->bh))
 		return 0;
 
 #ifdef DMA_CHUNK_SIZE
diff -ur --exclude-from /home/axboe/exclude /opt/kernel/linux-2.4.9/include/linux/blkdev.h linux/include/linux/blkdev.h
--- /opt/kernel/linux-2.4.9/include/linux/blkdev.h	Tue Aug 28 12:51:56 2001
+++ linux/include/linux/blkdev.h	Tue Aug 28 13:27:42 2001
@@ -126,10 +126,10 @@
 	wait_queue_head_t	wait_for_request;
 };
 
-extern unsigned long blk_max_low_pfn;
+extern unsigned long blk_max_low_pfn, blk_max_pfn;
 
 #define BLK_BOUNCE_HIGH		(blk_max_low_pfn * PAGE_SIZE)
-#define BLK_BOUNCE_ANY		(~(unsigned long long) 0)
+#define BLK_BOUNCE_ANY		(blk_max_pfn * PAGE_SIZE)
 
 extern void blk_queue_bounce_limit(request_queue_t *, dma64_addr_t);
 
@@ -150,6 +150,7 @@
 #define bh_phys(bh)		(page_to_phys((bh)->b_page) + bh_offset((bh)))
 
 #define BH_CONTIG(b1, b2)	(bh_phys((b1)) + (b1)->b_size == bh_phys((b2)))
+#define BH_PHYS_4G(b1, b2)	((bh_phys((b1)) | 0xffffffff) == ((bh_phys((b2)) + (b2)->b_size - 1) | 0xffffffff))
 
 struct blk_dev_struct {
 	/*
diff -ur --exclude-from /home/axboe/exclude /opt/kernel/linux-2.4.9/include/linux/bootmem.h linux/include/linux/bootmem.h
--- /opt/kernel/linux-2.4.9/include/linux/bootmem.h	Wed Aug 15 23:22:13 2001
+++ linux/include/linux/bootmem.h	Mon Aug 27 14:53:47 2001
@@ -18,6 +18,11 @@
 extern unsigned long min_low_pfn;
 
 /*
+ * highest page
+ */
+extern unsigned long max_pfn;
+
+/*
  * node_bootmem_map is a map pointer - the bits represent all physical 
  * memory pages (including holes) on the node.
  */

  reply	other threads:[~2001-08-28 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-27 10:37 [patch] zero-bounce block highmem I/O, #13 Jens Axboe
2001-08-28 10:26 ` Christoph Rohland
2001-08-28 10:41   ` Jens Axboe
2001-08-28 10:55   ` Jens Axboe
2001-08-28 11:41     ` Jens Axboe [this message]
2001-08-28 12:16       ` Christoph Rohland
2001-08-28 12:43         ` Jens Axboe
2001-08-28 15:59           ` Christoph Rohland
     [not found]     ` <m3elpw5smc.fsf@linux.local>
2001-08-28 11:45       ` Jens Axboe

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=20010828134141.M642@suse.de \
    --to=axboe@suse.de \
    --cc=cr@sap.com \
    --cc=davem@redhat.com \
    --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