linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: ric@emc.com, linux-ide@vger.kernel.org,
	Mark Lord <mlord@pobox.com>, Jens Axboe <axboe@suse.de>
Subject: Re: [RFT] major libata update
Date: Wed, 17 May 2006 08:23:25 +0900	[thread overview]
Message-ID: <446A5EED.7020902@gmail.com> (raw)
In-Reply-To: <446A4BF5.7080006@garzik.org>

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

Jeff Garzik wrote:
> Ric Wheeler wrote:
>>
>> One other note, it seems like this patch set has broken the write 
>> barrier support - is that a side effect of enabling NCQ still?
>>
>> I see messages that claim flush barriers are enabled:
>>
>> [root@c001n01 root]# mount -o 
>> barrier=flush,rw,noatime,nodiratime,data=ordered,notail /dev/sda10 /mnt/1
>> May 16 22:21:56 centera kernel: ReiserFS: sda10: found reiserfs format 
>> "3.6" with standard journal
>> [root@c001n01 root]# May 16 22:21:58 centera kernel: ReiserFS: sda10: 
>> using ordered data mode
>> May 16 22:21:58 centera kernel: reiserfs: using flush barriers
>> May 16 22:21:58 centera kernel: ReiserFS: sda10: journal params: 
>> device sda10, size 8192, journal first block 18, max trans len 1024, 
>> max batch 900, max commit age 30, max trans age 30
>> May 16 22:21:58 centera kernel: ReiserFS: sda10: checking transaction 
>> log (sda10)
>> May 16 22:21:58 centera kernel: ReiserFS: sda10: Using r5 hash to sort 
>> names
>>
>> But when I test with my synchronous write load, I am going at 6 times 
>> the normal rate (i.e., the rate I see with barriers disabled) ;-)
> 
> Well, NCQ read/write commands have a 'FUA' bit...  though maybe the NCQ 
> code forgot to check the global libata_fua.
> 

Hmmm.. The only place FUA is checked is ata_dev_supports_fua() 
regardless of NCQ, but I've seen FUA enabled with NCQ in another bug 
report, so I might have screwed up.  Ric, can you post the boot dmesg 
such that we know whether FUA is enabled or not?

I'm attaching a patch to print the progress of ordered sequence.  I've 
just tested with a NCQ drive loaded with 20 IO requests and it works. 
All requests are drained, preflush, barrier, then postflush.  Running 
the same test with the attached patch will tell us how barrier is working.

@ I can't believe this.  Last night two disks failed - one testing, one 
production.  Man, my harddrives are falling like flies.  Four test 
drives and one production drive failed during last two months.  Maybe 
they are striking back at me.  :-(

-- 
tejun

[-- Attachment #2: ordered_debug.patch --]
[-- Type: text/x-patch, Size: 3643 bytes --]

diff --git a/block/elevator.c b/block/elevator.c
index 8768a36..5cbd2b3 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -40,6 +40,8 @@ #include <asm/uaccess.h>
 static DEFINE_SPINLOCK(elv_list_lock);
 static LIST_HEAD(elv_list);
 
+#define pd(fmt, args...) 	printk("[%-24s]: " fmt, __FUNCTION__ , ##args);
+
 /*
  * can we safely merge with this request?
  */
@@ -548,6 +550,11 @@ struct request *elv_next_request(request
 		}
 	}
 
+	if (rq && (rq == &q->pre_flush_rq || rq == &q->post_flush_rq ||
+		   rq == &q->bar_rq))
+		pd("%p (%s)\n", rq,
+		   rq == &q->pre_flush_rq ?
+			"pre" : (rq == &q->post_flush_rq ? "post" : "bar"));
 	return rq;
 }
 
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index eac48be..eb1325c 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -30,6 +30,8 @@ #include <linux/interrupt.h>
 #include <linux/cpu.h>
 #include <linux/blktrace_api.h>
 
+#define pd(fmt, args...) 	printk("[%-24s]: " fmt, __FUNCTION__ , ##args);
+
 /*
  * for max sense size
  */
@@ -395,6 +397,9 @@ void blk_ordered_complete_seq(request_qu
 	struct request *rq;
 	int uptodate;
 
+	pd("ordseq=%02x seq=%02x orderr=%d error=%d\n",
+	   q->ordseq, seq, q->orderr, error);
+
 	if (error && !q->orderr)
 		q->orderr = error;
 
@@ -407,6 +412,7 @@ void blk_ordered_complete_seq(request_qu
 	/*
 	 * Okay, sequence complete.
 	 */
+	pd("sequence complete\n");
 	rq = q->orig_bar_rq;
 	uptodate = q->orderr ? q->orderr : 1;
 
@@ -461,6 +467,17 @@ static void queue_flush(request_queue_t 
 static inline struct request *start_ordered(request_queue_t *q,
 					    struct request *rq)
 {
+	struct bio *bio;
+	pd("%p -> %p,%p,%p infl=%u\n",
+	   rq, &q->pre_flush_rq, &q->bar_rq, &q->post_flush_rq, q->in_flight);
+	pd("%p %d %llu %lu %u %u %u %p\n", rq->bio, rq->errors,
+	   (unsigned long long)rq->hard_sector, rq->hard_nr_sectors,
+	   rq->current_nr_sectors, rq->nr_phys_segments, rq->nr_hw_segments,
+	   rq->buffer);
+	for (bio = rq->bio; bio; bio = bio->bi_next)
+		pd("BIO %p %llu %u\n",
+		   bio, (unsigned long long)bio->bi_sector, bio->bi_size);
+
 	q->bi_size = 0;
 	q->orderr = 0;
 	q->ordered = q->next_ordered;
@@ -499,6 +516,7 @@ static inline struct request *start_orde
 	} else
 		q->ordseq |= QUEUE_ORDSEQ_PREFLUSH;
 
+	pd("ordered=%x in_flight=%u\n", q->ordered, q->in_flight);
 	if ((q->ordered & QUEUE_ORDERED_TAG) || q->in_flight == 0)
 		q->ordseq |= QUEUE_ORDSEQ_DRAIN;
 	else
@@ -518,8 +536,10 @@ int blk_do_ordered(request_queue_t *q, s
 
 		if (q->next_ordered != QUEUE_ORDERED_NONE) {
 			*rqp = start_ordered(q, rq);
+			pd("start_ordered %p->%p\n", rq, *rqp);
 			return 1;
 		} else {
+			pd("ORDERED_NONE, seen barrier\n");
 			/*
 			 * This can happen when the queue switches to
 			 * ORDERED_NONE while this request is on it.
@@ -553,6 +573,7 @@ int blk_do_ordered(request_queue_t *q, s
 			*rqp = NULL;
 	}
 
+	pd("seq=%02x %p->%p\n", blk_ordered_cur_seq(q), rq, *rqp);
 	return 1;
 }
 
@@ -585,6 +606,9 @@ static int flush_dry_bio_endio(struct bi
 	bio->bi_sector -= (q->bi_size >> 9);
 	q->bi_size = 0;
 
+	pd("BIO %p %llu %u\n",
+	   bio, (unsigned long long)bio->bi_sector, bio->bi_size);
+
 	return 0;
 }
 
@@ -598,6 +622,7 @@ static inline int ordered_bio_endio(stru
 	if (&q->bar_rq != rq)
 		return 0;
 
+	pd("q->orderr=%d error=%d\n", q->orderr, error);
 	/*
 	 * Okay, this is the barrier request in progress, dry finish it.
 	 */
@@ -2864,6 +2889,7 @@ static int __make_request(request_queue_
 
 	barrier = bio_barrier(bio);
 	if (unlikely(barrier) && (q->next_ordered == QUEUE_ORDERED_NONE)) {
+		pd("ORDERED_NONE, seen barrier\n");
 		err = -EOPNOTSUPP;
 		goto end_io;
 	}

  parent reply	other threads:[~2006-05-16 23:22 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 17:00 [RFT] major libata update Jeff Garzik
2006-05-15 17:18 ` Andrew Morton
2006-05-15 18:06   ` Jeff Garzik
2006-05-15 19:06     ` Arkadiusz Miskiewicz
2006-05-15 20:45       ` Jeff Garzik
2006-05-15 19:33     ` Mark Lord
2006-05-15 22:52       ` Tejun Heo
2006-05-15 18:15   ` Jeff Garzik
2006-05-15 18:27     ` Andrew Morton
2006-05-15 18:44       ` Jeff Garzik
2006-05-15 18:37     ` Alan Cox
2006-05-15 17:19 ` Alan Cox
2006-05-15 17:13   ` Jeff Garzik
2006-05-15 18:29 ` Tomasz Torcz
2006-05-15 18:43   ` Jeff Garzik
2006-05-15 23:32     ` Tejun Heo
2006-05-15 23:49       ` Jeff Garzik
2006-05-16  0:04         ` Tejun Heo
2006-05-16  2:15           ` Tejun Heo
2006-05-15 19:15 ` Jeff Garzik
2006-05-15 23:02 ` Wakko Warner
2006-05-15 23:00   ` Jeff Garzik
2006-05-15 23:13     ` Wakko Warner
2006-05-15 23:19       ` Jeff Garzik
2006-05-15 23:40     ` Alan Cox
2006-05-15 23:50       ` Wakko Warner
2006-05-15 23:38   ` Alan Cox
2006-05-15 23:47     ` Wakko Warner
2006-05-15 23:45       ` Jeff Garzik
2006-05-15 23:30 ` Avuton Olrich
2006-05-15 23:36   ` Tejun Heo
2006-05-15 23:54   ` Jeff Garzik
2006-05-16  0:08     ` Avuton Olrich
2006-05-16  3:36     ` Avuton Olrich
2006-05-16  3:51       ` Jeff Garzik
2006-05-16  4:33         ` Avuton Olrich
2006-05-16 14:57           ` Linus Torvalds
2006-05-17 15:25             ` OGAWA Hirofumi
2006-05-17 23:40               ` Linus Torvalds
2006-05-17 23:48                 ` Jeff Garzik
2006-05-18  1:48                   ` Alan Cox
2006-05-17 23:49                 ` Linus Torvalds
2006-05-16 15:02           ` Jeff Garzik
2006-05-16  3:55       ` Tejun Heo
2006-05-16  4:37         ` Avuton Olrich
2006-05-16 11:36 ` Ric Wheeler
2006-05-16 14:25   ` Jeff Garzik
2006-05-16 15:24     ` Tejun Heo
2006-05-16 18:29       ` Ric Wheeler
2006-05-16 21:41         ` Ric Wheeler
2006-05-16 22:02           ` Jeff Garzik
2006-05-16 23:11             ` Eric D. Mudama
2006-05-17  2:13               ` Ric Wheeler
2006-05-16 23:23             ` Tejun Heo [this message]
2006-05-17  2:09               ` Ric Wheeler
2006-05-16 23:44         ` Tejun Heo
2006-05-16 23:53           ` Jeff Garzik
2006-05-17  0:00             ` Jeff Garzik
2006-05-17  0:29               ` Tejun Heo
2006-05-17  1:08                 ` Jeff Garzik
2006-05-17  1:27                   ` Tejun Heo
2006-05-17  2:26                     ` Jeff Garzik
2006-05-17  3:05                       ` Tejun Heo
2006-05-22  7:19                     ` Jeff Garzik
2006-05-23 13:59                       ` Tejun Heo
2006-05-17  0:31               ` Jeff Garzik
2006-05-17  0:50                 ` Tejun Heo
2006-05-17  0:57                   ` Tejun Heo
2006-05-17  2:22                     ` Ric Wheeler
2006-05-17  1:37                       ` Tejun Heo
2006-05-17  3:57                         ` Ric Wheeler
2006-05-17  4:44                           ` Tejun Heo
2006-05-17 11:30                             ` Ric Wheeler
2006-05-17 20:45                             ` Ric Wheeler
2006-05-17 21:01                             ` Mark Lord
2006-05-17 21:04                               ` Jeff Garzik
2006-05-17 21:50                                 ` Tejun Heo
2006-05-17 21:56                                   ` Mark Lord
2006-05-17 22:00                                     ` Jeff Garzik
2006-05-17 22:03                                       ` Mark Lord
2006-05-17 22:13                                         ` Jeff Garzik
2006-05-18  3:33                                     ` Ric Wheeler
2006-05-18  3:26                                       ` Tejun Heo
2006-05-18 11:58                                         ` Ric Wheeler
2006-05-18 12:52                                           ` Mark Lord
2006-05-18 13:22                                             ` Ric Wheeler
2006-05-18 13:37                                               ` Jens Axboe
2006-05-17  1:13                   ` Jeff Garzik
2006-05-17  1:14                   ` Jeff Garzik
2006-05-17  2:16           ` Ric Wheeler
2006-05-16 23:34       ` Jeff Garzik
2006-05-16 23:53         ` Tejun Heo
2006-05-17  2:05 ` Andrew Morton
2006-05-17  4:49   ` Tejun Heo
2006-05-17  4:56     ` Andrew Morton
2006-05-17  5:14       ` Tejun Heo
2006-05-17  6:35         ` Tejun Heo
2006-05-18 11:24           ` Albert Lee
2006-05-18 11:33             ` Tejun Heo
2006-05-19 10:37               ` Albert Lee
2006-05-19 11:03                 ` Tejun Heo
2006-05-22  3:51                   ` [PATCH 1/1] libata: use polling pio for identify device Albert Lee
2006-05-22  6:24                     ` Jeff Garzik
2006-05-23  2:27                       ` Albert Lee
2006-05-18 23:07           ` [RFT] major libata update Andrew Morton
2006-05-19  1:14             ` Tejun Heo
2006-05-19  2:06               ` Jeff Garzik
2006-05-19  2:16                 ` Tejun Heo
2006-05-22  7:22           ` Jeff Garzik
2006-05-21 23:51 ` Michael Sterrett -Mr. Bones.-
2006-05-22  2:42   ` Tejun Heo
2006-05-22  3:42     ` Michael Sterrett -Mr. Bones.-
2006-05-22  6:23     ` Michael Sterrett -Mr. Bones.-
  -- strict thread matches above, loose matches on Subject: below --
2006-05-17  7:35 Matthieu CASTET
2006-05-18  0:36 Brown, Len

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=446A5EED.7020902@gmail.com \
    --to=htejun@gmail.com \
    --cc=axboe@suse.de \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=mlord@pobox.com \
    --cc=ric@emc.com \
    /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).