Scsi problems in 2.5.1-pre9
Subsystems (3)
My hardware is a dual proc PII-300. I was running LTP runalltests.sh and it was on one of the growfiles tests when this problem occurred. The test hung, and I couldn't telnet into the machine or login to it, but I could switch between VC's. On the console, I had screenfulls of errors like this:
Incorrect number of segments after building list
counted 11, received 7
req nr_sec 1024, cur_nr_sec 8
Incorrect number of segments after building list
counted 14, received 10
req nr_sec 1024, cur_nr_sec 8
Incorrect number of segments after building list
counted 13, received 11
req nr_sec 584, cur_nr_sec 8
Incorrect number of segments after building list
counted 2, received 1
req nr_sec 16, cur_nr_sec 8
Incorrect number of segments after building list
counted 2, received 1
req nr_sec 16, cur_nr_sec 8
(scsi0:A:5:0): Locking max tag count at 64
After doing a hard reboot ext2 made me do a manual fsck, but it seems ok now. I was not able to produce this error in 2.5.1-pre8.
Thanks,
Paul Larson
Quoted 23 lines · Paul Larson
My hardware is a dual proc PII-300. I was running LTP
runalltests.shand it was on one of the growfiles tests when this problem occurred. The test hung, and I couldn't telnet into the machine or login to it, but I could switch between VC's. On the console, I had screenfulls of errors like this:Incorrect number of segments after building list
counted 11, received 7
reqnr_sec1024,cur_nr_sec8
Incorrect number of segments after building list
counted 14, received 10
reqnr_sec1024,cur_nr_sec8
Incorrect number of segments after building list
counted 13, received 11
reqnr_sec584,cur_nr_sec8
Incorrect number of segments after building list
counted 2, received 1
reqnr_sec16,cur_nr_sec8
Incorrect number of segments after building list
counted 2, received 1
reqnr_sec16,cur_nr_sec8
(scsi0:A:5:0): Locking max tag count at 64
Quoted 2 lines
After doing a hard reboot ext2 made me do a manual fsck, but it seems ok now. I was not able to produce this error in 2.5.1-pre8.
Please don't tell me what hardware you have :-)
Signature · 1 line
Jens Axboe
Quoted 24 lines · Jens Axboe
Quoted 23 lines · Paul Larson
My hardware is a dual proc PII-300. I was running LTP
runalltests.shand it was on one of the growfiles tests when this problem occurred. The test hung, and I couldn't telnet into the machine or login to it, but I could switch between VC's. On the console, I had screenfulls of errors like this:Incorrect number of segments after building list
counted 11, received 7
reqnr_sec1024,cur_nr_sec8
Incorrect number of segments after building list
counted 14, received 10
reqnr_sec1024,cur_nr_sec8
Incorrect number of segments after building list
counted 13, received 11
reqnr_sec584,cur_nr_sec8
Incorrect number of segments after building list
counted 2, received 1
reqnr_sec16,cur_nr_sec8
Incorrect number of segments after building list
counted 2, received 1
reqnr_sec16,cur_nr_sec8
(scsi0:A:5:0): Locking max tag count at 64
Quoted 4 lines
Quoted 2 lines
After doing a hard reboot ext2 made me do a manual fsck, but it seems ok now. I was not able to produce this error in 2.5.1-pre8.
Please don't tell me what hardware you have :-)
It seems to affect all SCSI drivers with CLUSTERING enabled. Don't worry about data consistency btw, the above is a warning only (the right segment count is used).
Signature · 1 line
Jens Axboe
Quoted 3 lines · Jens Axboe
It seems to affect all SCSI drivers with CLUSTERING enabled. Don't worry about data consistency btw, the above is a warning only (the right segment count is used).
So... this isn't a problem that my machine was locked up, I couldn't log in, or break out of the hung process, and it came back in an inconsistant state?
Quoted 7 lines · Paul Larson
Quoted 3 lines · Jens Axboe
It seems to affect all SCSI drivers with CLUSTERING enabled. Don't worry about data consistency btw, the above is a warning only (the right segment count is used).
So... this isn't a problem that my machine was locked up, I couldn't log in, or break out of the hung process, and it came back in an
Of course it's a problem, it locked because of hitting the segment BUG in ll_rw_blk most likely.
Quoted 1 line
inconsistant state?
... which fsck fixed, I'm saying the condition in itself does not cause data corruption.
Signature · 1 line
Jens Axboe
Quoted 8 lines · Paul Larson
My hardware is a dual proc PII-300. I was running LTP
runalltests.shand it was on one of the growfiles tests when this problem occurred. The test hung, and I couldn't telnet into the machine or login to it, but I could switch between VC's. On the console, I had screenfulls of errors like this:Incorrect number of segments after building list
counted 11, received 7
Attached patch should fix it.
Signature · 1 line
Jens Axboe
Quoted 3 lines
In that case you perhaps should be defining
DMA_CHUNK_SIZEinasm/dma.h:-)
Hmm I have it defined, just not in dma.h :) I'll fix it now and retest.
Anton
From: Anton Blanchard <[email protected]>
Date: Wed, 12 Dec 2001 09:17:47 +1100
Quoted 2 lines
In that case you perhaps should be defining
DMA_CHUNK_SIZEinasm/dma.h:-)
Hmm I have it defined, just not in dma.h :) I'll fix it now and retest.
Oh nevermind then, the location really is almost arbitrary. As long as scsi_merge.c sees it.
Note this is one area Jens hasn't been able to test and I've been trying first to solidify my sparc64 setup without DMA_CHUNK_SIZE defined.
Quoted 11 lines · David S. Miller
From: Jens Axboe <[email protected]>
Date: Wed, 12 Dec 2001 10:02:53 +0100Dave nailed this bug, Anton you'll want to apply it before testing :-) It fixes a case of too much copy'n paste with back merges +
DMA_CHUNK_SIZEenabled.There still are problems even after this fix.
In fact the failures look identical to what I was seeing before, first dbench from single user is insta-crash.
DMA_CHUNK_SIZE only, or regardless?
Signature · 1 line
Jens Axboe
From: Jens Axboe <[email protected]>
Date: Wed, 12 Dec 2001 10:21:48 +0100
Quoted 4 lines · David S. Miller
There still are problems even after this fix.
In fact the failures look identical to what I was seeing before, first dbench from single user is insta-crash.
DMA_CHUNK_SIZE only, or regardless?
DMA_CHUNK_SIZE is the only thing causing failures for me now.
Quoted 11 lines · Jens Axboe
Quoted 8 lines · Paul Larson
My hardware is a dual proc PII-300. I was running LTP
runalltests.shand it was on one of the growfiles tests when this problem occurred. The test hung, and I couldn't telnet into the machine or login to it, but I could switch between VC's. On the console, I had screenfulls of errors like this:Incorrect number of segments after building list
counted 11, received 7Attached patch should fix it.
Aghr, here it is. Linus, please apply to 2.5.1-pre9.
(and yes note how the differences between the stock and scsi merge functons are getting smaller -- in fact, we can complete merge the two now)
drivers/block/ll_rw_blk.c renamed from opt/kernel/linux-2.5.1-pre9/drivers/block/ll_rw_blk.c +12 -27
@@ -358,6 +358,8 @@if (!BIO_CONTIG (bio, nxt))return 0 ; +if (bio->bi_size + nxt->bi_size > q->max_segment_size) +return 0 ;/* * bio and nxt are contigous in memory, check if the queue allows
@@ -429,8 +431,10 @@* specific ones if so desired */ static inline int ll_new_segment (request_queue_t *q,struct request *req, -struct bio *bio,int nr_segs) +struct bio *bio) { +int nr_segs =bio_hw_segments (q, bio); +if (req->nr_segments + nr_segs <= q->max_segments) { req->nr_segments += nr_segs;return 1 ;
@@ -443,41 +447,23 @@static int ll_back_merge_fn (request_queue_t *q,struct request *req,struct bio *bio) { -int bio_segs; -if (req->nr_sectors +bio_sectors (bio) > q->max_sectors) { req->flags |=REQ_NOMERGE ;return 0 ; } - bio_segs =bio_hw_segments (q, bio); -if (blk_contig_segment (q, req->biotail, bio)) - bio_segs--; - -if (!bio_segs) -return 1 ; - -return ll_new_segment (q, req, bio, bio_segs); +return ll_new_segment (q, req, bio); }static int ll_front_merge_fn (request_queue_t *q,struct request *req,struct bio *bio) { -int bio_segs; -if (req->nr_sectors +bio_sectors (bio) > q->max_sectors) { req->flags |=REQ_NOMERGE ;return 0 ; } - bio_segs =bio_hw_segments (q, bio); -if (blk_contig_segment (q, bio, req->bio)) - bio_segs--; - -if (!bio_segs) -return 1 ; - -return ll_new_segment (q, req, bio, bio_segs); +return ll_new_segment (q, req, bio); } static int ll_merge_requests_fn(request_queue_t *q, struct request *req,
@@ -1235,11 +1221,6 @@break ; } -/* -* this needs to be handled by q->make_request_fn, to just -* setup a part of the bio in the request to enable easy -* multiple passing -*/ BUG_ON (bio_sectors (bio) > q->max_sectors);/*
@@ -1497,6 +1478,7 @@while ((bio = req->bio)) { nsect =bio_iovec (bio)->bv_len >>9 ; +BIO_BUG_ON (bio_iovec (bio)->bv_len > bio->bi_size);/* * not a complete bvec done
@@ -1515,11 +1497,12 @@* account transfer */ bio->bi_size -=bio_iovec (bio)->bv_len; + bio->bi_idx++; nr_sectors -= nsect; total_nsect += nsect; -if (++bio->bi_idx >= bio->bi_vcnt) { +if (!bio->bi_size) { req->bio = bio->bi_next;if (unlikely (bio_endio (bio, uptodate, total_nsect)))
@@ -1619,7 +1602,9 @@EXPORT_SYMBOL (blk_queue_max_segments);EXPORT_SYMBOL (blk_queue_max_segment_size);EXPORT_SYMBOL (blk_queue_hardsect_size); +EXPORT_SYMBOL (blk_queue_segment_boundary);EXPORT_SYMBOL (blk_rq_map_sg);EXPORT_SYMBOL (blk_nohighio);EXPORT_SYMBOL (blk_dump_rq_flags);EXPORT_SYMBOL (submit_bio); +EXPORT_SYMBOL (blk_contig_segment);
drivers/scsi/ide-scsi.c renamed from opt/kernel/linux-2.5.1-pre9/drivers/scsi/ide-scsi.c +4 -3
@@ -261,7 +261,7 @@ide_drive_t *drive = hwgroup->drive;idescsi_scsi_t *scsi = drive->driver_data;struct request *rq = hwgroup->rq; -idescsi_pc_t *pc = (idescsi_pc_t *) rq->buffer; +idescsi_pc_t *pc = (idescsi_pc_t *) rq->special;int log =test_bit (IDESCSI_LOG_CMD , &scsi->log);struct Scsi_Host *host;u8 *scsi_buf;
@@ -464,7 +464,7 @@#endif /* IDESCSI_DEBUG_LOG */ if (rq->flags &REQ_SPECIAL ) { -return idescsi_issue_pc (drive, (idescsi_pc_t *) rq->buffer); +return idescsi_issue_pc (drive, (idescsi_pc_t *) rq->special); }blk_dump_rq_flags (rq,"ide-scsi: unsup command" );idescsi_end_request (0 ,HWGROUP (drive));
@@ -662,6 +662,7 @@if ((first_bh = bhp = bh =bio_alloc (GFP_ATOMIC ,1 )) ==NULL ) goto abort;bio_init (bh); + bh->bi_vcnt =1 ;while (--count) {if ((bh =bio_alloc (GFP_ATOMIC ,1 )) ==NULL ) goto abort;
@@ -802,7 +803,7 @@ }ide_init_drive_cmd (rq); - rq->buffer = (char *) pc; + rq->special = (char *) pc; rq->bio =idescsi_dma_bio (drive, pc); rq->flags =REQ_SPECIAL ;spin_unlock (&cmd->host->host_lock);
drivers/scsi/scsi_merge.c renamed from opt/kernel/linux-2.5.1-pre9/drivers/scsi/scsi_merge.c +23 -70
174 lines not on this page · raw message
fs/bio.c renamed from opt/kernel/linux-2.5.1-pre9/fs/bio.c +6 -43
83 lines not on this page · raw message
fs/partitions/acorn.c renamed from opt/kernel/linux-2.5.1-pre9/fs/partitions/acorn.c +3 -3
@@ -162,12 +162,12 @@struct adfs_discrecord *dr;unsigned int nr_sects; -if (!(minor & mask)) -break ; - data =read_dev_sector (bdev, start_blk *2 +6 , §);if (!data)return -1 ; + +if (!(minor & mask)) +break ; dr =adfs_partition (hd, name, data, first_sector, minor++);if (!dr)
fs/partitions/check.h renamed from opt/kernel/linux-2.5.1-pre9/fs/partitions/check.h +2 -0
@@ -1,3 +1,5 @@ +#include <linux/pagemap.h> +/* * add_gd_partition adds a partitions details to the devices partition * description.
include/linux/bio.h renamed from opt/kernel/linux-2.5.1-pre9/include/linux/bio.h +3 -1
@@ -28,6 +28,8 @@#define BIO_BUG_ON #endif +#define BIO_MAX_SECTORS 128 +/* * was unsigned short, but we might as well be ready for > 64kB I/O pages */
@@ -60,7 +62,7 @@unsigned short bi_vcnt;/* how many bio_vec's */ unsigned short bi_idx;/* current index into bvl_vec */ unsigned short bi_hw_seg;/* actual mapped segments */ -unsigned int bi_size;/* total size in bytes */ +unsigned int bi_size;/* residual I/O count */ unsigned int bi_max;/* max bvl_vecs we can hold, used as index into pool */
Signature · 1 line
Jens Axboe
Hi Jens,
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Incorrect number of segments after building list
counted 11, received 7Attached patch should fix it.
I just booted 2.5.1-pre10 on ppc64 and still get the errors:
Incorrect number of segments after building list
counted 3, received 2
req nr_sec 24, cur_nr_sec 8
This seems to be happening because we now allow sg merging through the BIOVEC_MERGEABLE macro. On ppc64 (and sparc64) we can coalesce two sg entries if the first one ends on a page boundary and the next one starts on a page boundary because we have an IO MMU. (I know that you know this, Im just explaining it for those who dont :)
Should we just remove the warning now?
Anton
From: Anton Blanchard <[email protected]>
Date: Wed, 12 Dec 2001 08:28:02 +1100
This seems to be happening because we now allow sg merging through the BIOVEC_MERGEABLE macro. On ppc64 (and sparc64) we can coalesce two sg entries if the first one ends on a page boundary and the next one starts on a page boundary because we have an IO MMU. (I know that you know this, Im just explaining it for those who dont :)
In that case you perhaps should be defining DMA_CHUNK_SIZE in asm/dma.h :-)
Quoted 6 lines · David S. Miller
From: Anton Blanchard <[email protected]>
Date: Wed, 12 Dec 2001 09:17:47 +1100Quoted 2 lines
In that case you perhaps should be defining
DMA_CHUNK_SIZEinasm/dma.h:-)
Quoted 8 lines
Hmm I have it defined, just not in
dma.h:) I'll fix it now and retest.Oh nevermind then, the location really is almost arbitrary. As long as
scsi_merge.csees it.Note this is one area Jens hasn't been able to test and I've been trying first to solidify my sparc64 setup without
DMA_CHUNK_SIZEdefined.
Dave nailed this bug, Anton you'll want to apply it before testing :-) It fixes a case of too much copy'n paste with back merges + DMA_CHUNK_SIZE enabled.
Signature · 1 line
Jens Axboe
scsi/scsi_merge.c renamed from opt/kernel/linux-2.5.1-pre10/drivers/scsi/scsi_merge.c +1 -1
@@ -307,7 +307,7 @@ }#ifdef DMA_CHUNK_SIZE -if (MERGEABLE_BUFFERS (bio, req->bio)) +if (MERGEABLE_BUFFERS (req->biotail, bio))return scsi_new_mergeable (q, req, bio);#endif
From: Jens Axboe <[email protected]>
Date: Wed, 12 Dec 2001 10:02:53 +0100
Dave nailed this bug, Anton you'll want to apply it before testing :-) It fixes a case of too much copy'n paste with back merges + DMA_CHUNK_SIZE enabled.
There still are problems even after this fix.
In fact the failures look identical to what I was seeing before, first dbench from single user is insta-crash.
Quoted 6 lines · David S. Miller
From: Jens Axboe <[email protected]>
Date: Wed, 12 Dec 2001 10:21:48 +0100Quoted 2 lines · David S. Miller
There still are problems even after this fix.
Quoted 7 lines
Quoted 2 lines
In fact the failures look identical to what I was seeing before, first dbench from single user is insta-crash.
DMA_CHUNK_SIZEonly, or regardless?
DMA_CHUNK_SIZEis the only thing causing failures for me now.
Alright, that's a least good news to some extent :-)
Signature · 1 line
Jens Axboe