Skip to contentSkip to conversation

block updates for 2.6.30-rc1

GIT PULL Jens Axboe 3 participants 5 messages Apr 7, 2009

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

Hi Linus,

This is the collected set of small updates in the block area, as well as the CFQ update you tested yesterday. It's essentially the same, but allows for a bit more queuing for a solitary IO issuer. If it ends up interferring too much with new IO, I'll augment that check with a time based one as well. Looks good here, though.

There's also a fix for a long standing CFQ problem that caused slowdowns with CFQ on streamed IO due to CFQ being too eager to restart IO queuing.

git://git.kernel.dk/linux-2.6-block.git for-linus

Jens Axboe (6):
block: elevator quiescing helpers
cciss: fix residual count for block pc requests
cfq-iosched: change dispatch logic to deal with single requests at the time
cfq-iosched: kill two unused cfqq flags
block: remove unused REQ_UNPLUG
cfq-iosched: don't let idling interfere with plugging

Jerome Marchand (1):
block: fix inconsistency in I/O stat accounting code

Mike Miller (2):
cciss: kernel scan thread for MSA2012
cciss: change to discover first memory BAR

unsik Kim (1):
mflash: initial support

 Documentation/blockdev/00-INDEX   |    2 +
 Documentation/blockdev/mflash.txt |   84 +++
 block/blk-core.c                  |   15 +-
 block/blk-merge.c                 |   29 +-
 block/blk-sysfs.c                 |    4 +
 block/blk.h                       |   14 +-
 block/cfq-iosched.c               |  202 ++++----
 block/elevator.c                  |   42 +-
 drivers/block/Kconfig             |   17 +
 drivers/block/Makefile            |    1 +
 drivers/block/cciss.c             |  117 ++++-
 drivers/block/cciss.h             |    2 +
 drivers/block/cciss_cmd.h         |   23 +
 drivers/block/mg_disk.c           | 1005 +++++++++++++++++++++++++++++++++++++
 include/linux/blkdev.h            |    2 -
 include/linux/elevator.h          |    1 +
 include/linux/mg_disk.h           |  206 ++++++++
 17 files changed, 1619 insertions(+), 147 deletions(-)
 create mode 100644 Documentation/blockdev/mflash.txt
 create mode 100644 drivers/block/mg_disk.c
 create mode 100644 include/linux/mg_disk.h

---

Documentation/blockdev/00-INDEX +2 -0
index 86f054c..c08df56 100644
@@ -8,6 +8,8 @@ cpqarray.txt
 	- info on using Compaq's SMART2 Intelligent Disk Array Controllers.
 floppy.txt
 	- notes and driver options for the floppy disk driver.
+mflash.txt
+	- info on mGine m(g)flash driver for linux.
 nbd.txt
 	- info on a TCP implementation of a network block device.
 paride.txt
Documentation/blockdev/mflash.txt new file +84 -0

84 lines not on this page · raw message

block/blk-core.c +4 -11
index 2557280..43fdedc 100644
@@ -64,12 +64,11 @@ static struct workqueue_struct *kblockd_workqueue;
 
 static void drive_stat_acct(struct request *rq, int new_io)
 {
-	struct gendisk *disk = rq->rq_disk;
 	struct hd_struct *part;
 	int rw = rq_data_dir(rq);
 	int cpu;
 
-	if (!blk_fs_request(rq) || !disk || !blk_do_io_stat(disk->queue))
+	if (!blk_fs_request(rq) || !blk_do_io_stat(rq))
 		return;
 
 	cpu = part_stat_lock();
@@ -1124,8 +1123,6 @@ void init_request_from_bio(struct request *req, struct bio *bio)
 
 	if (bio_sync(bio))
 		req->cmd_flags |= REQ_RW_SYNC;
-	if (bio_unplug(bio))
-		req->cmd_flags |= REQ_UNPLUG;
 	if (bio_rw_meta(bio))
 		req->cmd_flags |= REQ_RW_META;
 	if (bio_noidle(bio))
@@ -1675,9 +1672,7 @@ EXPORT_SYMBOL(blkdev_dequeue_request);
 
 static void blk_account_io_completion(struct request *req, unsigned int bytes)
 {
-	struct gendisk *disk = req->rq_disk;
-
-	if (!disk || !blk_do_io_stat(disk->queue))
+	if (!blk_do_io_stat(req))
 		return;
 
 	if (blk_fs_request(req)) {
@@ -1694,9 +1689,7 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes)
 
 static void blk_account_io_done(struct request *req)
 {
-	struct gendisk *disk = req->rq_disk;
-
-	if (!disk || !blk_do_io_stat(disk->queue))
+	if (!blk_do_io_stat(req))
 		return;
 
 	/*
@@ -1711,7 +1704,7 @@ static void blk_account_io_done(struct request *req)
 		int cpu;
 
 		cpu = part_stat_lock();
-		part = disk_map_sector_rcu(disk, req->sector);
+		part = disk_map_sector_rcu(req->rq_disk, req->sector);
 
 		part_stat_inc(cpu, part, ios[rw]);
 		part_stat_add(cpu, part, ticks[rw], duration);
block/blk-merge.c +17 -12
index e39cb24..63760ca 100644
@@ -338,6 +338,22 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
 	return 1;
 }
 
+static void blk_account_io_merge(struct request *req)
+{
+	if (blk_do_io_stat(req)) {
+		struct hd_struct *part;
+		int cpu;
+
+		cpu = part_stat_lock();
+		part = disk_map_sector_rcu(req->rq_disk, req->sector);
+
+		part_round_stats(cpu, part);
+		part_dec_in_flight(part);
+
+		part_stat_unlock();
+	}
+}
+
 /*
  * Has to be called with the request spinlock acquired
  */
@@ -386,18 +402,7 @@ static int attempt_merge(struct request_queue *q, struct request *req,
 
 	elv_merge_requests(q, req, next);
 
-	if (req->rq_disk) {
-		struct hd_struct *part;
-		int cpu;
-
-		cpu = part_stat_lock();
-		part = disk_map_sector_rcu(req->rq_disk, req->sector);
-
-		part_round_stats(cpu, part);
-		part_dec_in_flight(part);
-
-		part_stat_unlock();
-	}
+	blk_account_io_merge(req);
 
 	req->ioprio = ioprio_best(req->ioprio, next->ioprio);
 	if (blk_rq_cpu_valid(next))
block/blk-sysfs.c +4 -0
index 3ff9bba..73f36be 100644
@@ -209,10 +209,14 @@ static ssize_t queue_iostats_store(struct request_queue *q, const char *page,
 	ssize_t ret = queue_var_store(&stats, page, count);
 
 	spin_lock_irq(q->queue_lock);
+	elv_quisce_start(q);
+
 	if (stats)
 		queue_flag_set(QUEUE_FLAG_IO_STAT, q);
 	else
 		queue_flag_clear(QUEUE_FLAG_IO_STAT, q);
+
+	elv_quisce_end(q);
 	spin_unlock_irq(q->queue_lock);
 
 	return ret;
block/blk.h +10 -4
index 3ee9435..24fcaee 100644
@@ -70,6 +70,10 @@ void blk_queue_congestion_threshold(struct request_queue *q);
 
 int blk_dev_init(void);
 
+void elv_quisce_start(struct request_queue *q);
+void elv_quisce_end(struct request_queue *q);
+
+
 /*
  * Return the threshold (number of used requests) at which the queue is
  * considered to be congested.  It include a little hysteresis to keep the
@@ -108,12 +112,14 @@ static inline int blk_cpu_to_group(int cpu)
 #endif
 }
 
-static inline int blk_do_io_stat(struct request_queue *q)
+static inline int blk_do_io_stat(struct request *rq)
 {
-	if (q)
-		return blk_queue_io_stat(q);
+	struct gendisk *disk = rq->rq_disk;
 
-	return 0;
+	if (!disk || !disk->queue)
+		return 0;
+
+	return blk_queue_io_stat(disk->queue) && (rq->cmd_flags & REQ_ELVPRIV);
 }
 
 #endif
block/cfq-iosched.c +106 -96

320 lines not on this page · raw message

block/elevator.c +28 -14

66 lines not on this page · raw message

drivers/block/Kconfig +17 -0
index e7b8aa0..ddea8e4 100644
@@ -410,6 +410,23 @@ config ATA_OVER_ETH
 	This driver provides Support for ATA over Ethernet block
 	devices like the Coraid EtherDrive (R) Storage Blade.
 
+config MG_DISK
+	tristate "mGine mflash, gflash support"
+	depends on ARM && ATA && GPIOLIB
+	help
+	  mGine mFlash(gFlash) block device driver
+
+config MG_DISK_RES
+	int "Size of reserved area before MBR"
+	depends on MG_DISK
+	default 0
+	help
+	  Define size of reserved area that usually used for boot. Unit is KB.
+	  All of the block device operation will be taken this value as start
+	  offset
+	  Examples:
+			1024 => 1 MB
+
 config SUNVDC
 	tristate "Sun Virtual Disk Client support"
 	depends on SUN_LDOMS
drivers/block/Makefile +1 -0
index 3145141..7755a5e 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_BLK_CPQ_CISS_DA)  += cciss.o
 obj-$(CONFIG_BLK_DEV_DAC960)	+= DAC960.o
 obj-$(CONFIG_XILINX_SYSACE)	+= xsysace.o
 obj-$(CONFIG_CDROM_PKTCDVD)	+= pktcdvd.o
+obj-$(CONFIG_MG_DISK)		+= mg_disk.o
 obj-$(CONFIG_SUNVDC)		+= sunvdc.o
 
 obj-$(CONFIG_BLK_DEV_UMEM)	+= umem.o
drivers/block/cciss.c +109 -8

213 lines not on this page · raw message

drivers/block/cciss.h +2 -0
index 15e2b84..703e080 100644
@@ -121,6 +121,8 @@ struct ctlr_info
 	struct sendcmd_reject_list scsi_rejects;
 #endif
 	unsigned char alive;
+	struct completion *rescan_wait;
+	struct task_struct *cciss_scan_thread;
 };
 
 /*  Defining the diffent access_menthods */
drivers/block/cciss_cmd.h +23 -0
index 24e22de..40b1b92 100644
@@ -25,6 +25,29 @@
 #define CMD_TIMEOUT             0x000B
 #define CMD_UNABORTABLE		0x000C
 
+/* Unit Attentions ASC's as defined for the MSA2012sa */
+#define POWER_OR_RESET			0x29
+#define STATE_CHANGED			0x2a
+#define UNIT_ATTENTION_CLEARED		0x2f
+#define LUN_FAILED			0x3e
+#define REPORT_LUNS_CHANGED		0x3f
+
+/* Unit Attentions ASCQ's as defined for the MSA2012sa */
+
+	/* These ASCQ's defined for ASC = POWER_OR_RESET */
+#define POWER_ON_RESET			0x00
+#define POWER_ON_REBOOT			0x01
+#define SCSI_BUS_RESET			0x02
+#define MSA_TARGET_RESET		0x03
+#define CONTROLLER_FAILOVER		0x04
+#define TRANSCEIVER_SE			0x05
+#define TRANSCEIVER_LVD			0x06
+
+	/* These ASCQ's defined for ASC = STATE_CHANGED */
+#define RESERVATION_PREEMPTED		0x03
+#define ASYM_ACCESS_CHANGED		0x06
+#define LUN_CAPACITY_CHANGED		0x09
+
 //transfer direction
 #define XFER_NONE               0x00
 #define XFER_WRITE              0x01
drivers/block/mg_disk.c new file +1005 -0

1,005 lines not on this page · raw message

include/linux/blkdev.h +0 -2
index e036609..ba54c83 100644
@@ -117,7 +117,6 @@ enum rq_flag_bits {
 	__REQ_RW_META,		/* metadata io request */
 	__REQ_COPY_USER,	/* contains copies of user pages */
 	__REQ_INTEGRITY,	/* integrity metadata has been remapped */
-	__REQ_UNPLUG,		/* unplug queue on submission */
 	__REQ_NOIDLE,		/* Don't anticipate more IO after this one */
 	__REQ_NR_BITS,		/* stops here */
 };
@@ -145,7 +144,6 @@ enum rq_flag_bits {
 #define REQ_RW_META	(1 << __REQ_RW_META)
 #define REQ_COPY_USER	(1 << __REQ_COPY_USER)
 #define REQ_INTEGRITY	(1 << __REQ_INTEGRITY)
-#define REQ_UNPLUG	(1 << __REQ_UNPLUG)
 #define REQ_NOIDLE	(1 << __REQ_NOIDLE)
 
 #define BLK_MAX_CDB	16
include/linux/elevator.h +1 -0
index 7a20425..c59b769 100644
@@ -116,6 +116,7 @@ extern void elv_abort_queue(struct request_queue *);
 extern void elv_completed_request(struct request_queue *, struct request *);
 extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
 extern void elv_put_request(struct request_queue *, struct request *);
+extern void elv_drain_elevator(struct request_queue *);
 
 /*
  * io scheduler registration
include/linux/mg_disk.h new file +206 -0

206 lines not on this page · raw message

Signature · 1 line
Jens Axboe
#1 lore raw

2009/4/7 Jens Axboe <[email protected]>:

Quoted 8 lines

Hi Linus,

This is the collected set of small updates in the block area, as well as the CFQ update you tested yesterday. It's essentially the same, but allows for a bit more queuing for a solitary IO issuer. If it ends up interferring too much with new IO, I'll augment that check with a time based one as well. Looks good here, though.

Quoted 6 lines

There's also a fix for a long standing CFQ problem that caused slowdowns with CFQ on streamed IO due to CFQ being too eager to restart IO queuing.

 git://git.kernel.dk/linux-2.6-block.git for-linus

Hi Jens

I sent you a fix for loop device.
http://patchwork.kernel.org/patch/15763/

author
#2 lore raw
Quoted 13 lines · Alexander Beregalov

2009/4/7 Jens Axboe <[email protected]>:

Quoted 12 lines

Hi Linus,

This is the collected set of small updates in the block area, as well as the CFQ update you tested yesterday. It's essentially the same, but allows for a bit more queuing for a solitary IO issuer. If it ends up interferring too much with new IO, I'll augment that check with a time based one as well. Looks good here, though.

There's also a fix for a long standing CFQ problem that caused slowdowns with CFQ on streamed IO due to CFQ being too eager to restart IO queuing.

Quoted 7 lines
Quoted 2 lines

 git://git.kernel.dk/linux-2.6-block.git for-linus

Hi Jens

I sent you a fix for loop device.
http://patchwork.kernel.org/patch/15763/

I missed that the thread had the loop fix as well. I've included it now, looks fine to me. Linus, the new diffstat is now:

 Dumentation/blockdev/00-INDEX   |    2 
 Documentation/blockdev/mflash.txt |   84 ++
 block/blk-core.c                  |   15 
 block/blk-merge.c                 |   29 
 block/blk-sysfs.c                 |    4 
 block/blk.h                       |   14 
 block/cfq-iosched.c               |  202 +++---
 block/elevator.c                  |   42 -
 drivers/block/Kconfig             |   17 
 drivers/block/Makefile            |    1 
 drivers/block/cciss.c             |  117 +++
 drivers/block/cciss.h             |    2 
 drivers/block/cciss_cmd.h         |   23 
 drivers/block/loop.c              |    7 
 drivers/block/mg_disk.c           | 1005 ++++++++++++++++++++++++++++++
 include/linux/blkdev.h            |    2 
 include/linux/elevator.h          |    1 
 include/linux/mg_disk.h           |  206 ++++++
 18 files changed, 1624 insertions(+), 149 deletions(-)
Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 5 lines · Jens Axboe
Quoted 2 lines

I sent you a fix for loop device.
http://patchwork.kernel.org/patch/15763/

I missed that the thread had the loop fix as well. I've included it now, looks fine to me. Linus, the new diffstat is now:

No, I still see the old diffstat. Did you forget to push out?

Linus

author
#4 lore raw
Quoted 10 lines · Linus Torvalds
Quoted 5 lines · Jens Axboe
Quoted 2 lines

I sent you a fix for loop device.
http://patchwork.kernel.org/patch/15763/

I missed that the thread had the loop fix as well. I've included it now, looks fine to me. Linus, the new diffstat is now:

No, I still see the old diffstat. Did you forget to push out?

Ehm yep, it appears so... It's pushed now.

Signature · 1 line
Jens Axboe