linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: axboe@suse.de, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [BLOCK] phys_contig implies hw_contig
Date: Sat, 1 Nov 2003 13:31:27 +1100	[thread overview]
Message-ID: <20031101023127.GA14438@gondor.apana.org.au> (raw)

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

Hi:

In ll_merge_requests_fn, it is checking blk_hw_contig_segments even if
blk_phys_contig_segments succeeds.  This means that it may cause two
physically contiguous segments to be separated because the hw check
fails.

This patch fixes that.

Cheers,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1130 bytes --]

Index: kernel-source-2.5/drivers/block/ll_rw_blk.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/block/ll_rw_blk.c,v
retrieving revision 1.9
diff -u -r1.9 ll_rw_blk.c
--- kernel-source-2.5/drivers/block/ll_rw_blk.c	11 Oct 2003 06:29:20 -0000	1.9
+++ kernel-source-2.5/drivers/block/ll_rw_blk.c	1 Nov 2003 02:24:52 -0000
@@ -1046,16 +1046,16 @@
 		return 0;
 
 	total_phys_segments = req->nr_phys_segments + next->nr_phys_segments;
-	if (blk_phys_contig_segment(q, req->biotail, next->bio))
+	total_hw_segments = req->nr_hw_segments + next->nr_hw_segments;
+
+	if (blk_phys_contig_segment(q, req->biotail, next->bio)) {
 		total_phys_segments--;
+		total_hw_segments--;
+	} else if (blk_hw_contig_segment(q, req->biotail, next->bio))
+		total_hw_segments--;
 
 	if (total_phys_segments > q->max_phys_segments)
 		return 0;
-
-	total_hw_segments = req->nr_hw_segments + next->nr_hw_segments;
-	if (blk_hw_contig_segment(q, req->biotail, next->bio))
-		total_hw_segments--;
-
 	if (total_hw_segments > q->max_hw_segments)
 		return 0;
 

             reply	other threads:[~2003-11-01  2:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-01  2:31 Herbert Xu [this message]
2003-11-02  4:45 ` [BLOCK] phys_contig implies hw_contig David S. Miller
2003-11-02  4:47   ` Herbert Xu
2003-11-02 22:10     ` Herbert Xu
2003-11-03 22:40       ` David S. Miller

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=20031101023127.GA14438@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=axboe@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).