Commit e443343e authored by Stefan Haberland's avatar Stefan Haberland Committed by Martin Schwidefsky

s390/dasd: blk-mq conversion

Use new blk-mq interfaces. Use multiple queues and also use the block
layer complete helper that finish the IO on the CPU that initiated it.
Reviewed-by: default avatarJan Hoeppner <hoeppner@linux.vnet.ibm.com>
Signed-off-by: default avatarStefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f28a4b4d
This diff is collapsed.
...@@ -1326,7 +1326,7 @@ dasd_timeout_store(struct device *dev, struct device_attribute *attr, ...@@ -1326,7 +1326,7 @@ dasd_timeout_store(struct device *dev, struct device_attribute *attr,
{ {
struct dasd_device *device; struct dasd_device *device;
struct request_queue *q; struct request_queue *q;
unsigned long val, flags; unsigned long val;
device = dasd_device_from_cdev(to_ccwdev(dev)); device = dasd_device_from_cdev(to_ccwdev(dev));
if (IS_ERR(device) || !device->block) if (IS_ERR(device) || !device->block)
...@@ -1342,16 +1342,10 @@ dasd_timeout_store(struct device *dev, struct device_attribute *attr, ...@@ -1342,16 +1342,10 @@ dasd_timeout_store(struct device *dev, struct device_attribute *attr,
dasd_put_device(device); dasd_put_device(device);
return -ENODEV; return -ENODEV;
} }
spin_lock_irqsave(&device->block->request_queue_lock, flags);
if (!val)
blk_queue_rq_timed_out(q, NULL);
else
blk_queue_rq_timed_out(q, dasd_times_out);
device->blk_timeout = val; device->blk_timeout = val;
blk_queue_rq_timeout(q, device->blk_timeout * HZ); blk_queue_rq_timeout(q, device->blk_timeout * HZ);
spin_unlock_irqrestore(&device->block->request_queue_lock, flags);
dasd_put_device(device); dasd_put_device(device);
return count; return count;
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include <asm/dasd.h> #include <asm/dasd.h>
#include <asm/idals.h> #include <asm/idals.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/blk-mq.h>
/* DASD discipline magic */ /* DASD discipline magic */
#define DASD_ECKD_MAGIC 0xC5C3D2C4 #define DASD_ECKD_MAGIC 0xC5C3D2C4
...@@ -185,6 +186,7 @@ struct dasd_ccw_req { ...@@ -185,6 +186,7 @@ struct dasd_ccw_req {
char status; /* status of this request */ char status; /* status of this request */
short retries; /* A retry counter */ short retries; /* A retry counter */
unsigned long flags; /* flags of this request */ unsigned long flags; /* flags of this request */
struct dasd_queue *dq;
/* ... and how */ /* ... and how */
unsigned long starttime; /* jiffies time of request start */ unsigned long starttime; /* jiffies time of request start */
...@@ -248,6 +250,16 @@ struct dasd_ccw_req { ...@@ -248,6 +250,16 @@ struct dasd_ccw_req {
#define DASD_CQR_SUPPRESS_IL 6 /* Suppress 'Incorrect Length' error */ #define DASD_CQR_SUPPRESS_IL 6 /* Suppress 'Incorrect Length' error */
#define DASD_CQR_SUPPRESS_CR 7 /* Suppress 'Command Reject' error */ #define DASD_CQR_SUPPRESS_CR 7 /* Suppress 'Command Reject' error */
/*
* There is no reliable way to determine the number of available CPUs on
* LPAR but there is no big performance difference between 1 and the
* maximum CPU number.
* 64 is a good trade off performance wise.
*/
#define DASD_NR_HW_QUEUES 64
#define DASD_MAX_LCU_DEV 256
#define DASD_REQ_PER_DEV 4
/* Signature for error recovery functions. */ /* Signature for error recovery functions. */
typedef struct dasd_ccw_req *(*dasd_erp_fn_t) (struct dasd_ccw_req *); typedef struct dasd_ccw_req *(*dasd_erp_fn_t) (struct dasd_ccw_req *);
...@@ -539,6 +551,7 @@ struct dasd_block { ...@@ -539,6 +551,7 @@ struct dasd_block {
struct gendisk *gdp; struct gendisk *gdp;
struct request_queue *request_queue; struct request_queue *request_queue;
spinlock_t request_queue_lock; spinlock_t request_queue_lock;
struct blk_mq_tag_set tag_set;
struct block_device *bdev; struct block_device *bdev;
atomic_t open_count; atomic_t open_count;
...@@ -563,6 +576,10 @@ struct dasd_attention_data { ...@@ -563,6 +576,10 @@ struct dasd_attention_data {
__u8 lpum; __u8 lpum;
}; };
struct dasd_queue {
spinlock_t lock;
};
/* reasons why device (ccw_device_start) was stopped */ /* reasons why device (ccw_device_start) was stopped */
#define DASD_STOPPED_NOT_ACC 1 /* not accessible */ #define DASD_STOPPED_NOT_ACC 1 /* not accessible */
#define DASD_STOPPED_QUIESCE 2 /* Quiesced */ #define DASD_STOPPED_QUIESCE 2 /* Quiesced */
...@@ -731,7 +748,7 @@ void dasd_free_device(struct dasd_device *); ...@@ -731,7 +748,7 @@ void dasd_free_device(struct dasd_device *);
struct dasd_block *dasd_alloc_block(void); struct dasd_block *dasd_alloc_block(void);
void dasd_free_block(struct dasd_block *); void dasd_free_block(struct dasd_block *);
enum blk_eh_timer_return dasd_times_out(struct request *req); enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved);
void dasd_enable_device(struct dasd_device *); void dasd_enable_device(struct dasd_device *);
void dasd_set_target_state(struct dasd_device *, int); void dasd_set_target_state(struct dasd_device *, int);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment