diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 10:48:24 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 10:48:24 -0400 |
| commit | 97c68d00dbb2decda4b3dce79ce55df04246a834 (patch) | |
| tree | f7c2f3185e4dfb073f6d268b4aa0a4d9a0015ece | |
| parent | 596a5c4e43b08e90c0cd788861f859bf7ed6eddc (diff) | |
| parent | f2d1f0ae7851be5ebd9613a80dac139270938809 (diff) | |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
cfq-iosched: cache prio_tree root in cfqq->p_root
cfq-iosched: fix bug with aliased request and cooperation detection
cfq-iosched: clear ->prio_trees[] on cfqd alloc
block: fix intermittent dm timeout based oops
umem: fix request_queue lock warning
block: simplify I/O stat accounting
pktcdvd.h should include mempool.h
cfq-iosched: use the default seek distance when there aren't enough seek samples
cfq-iosched: make seek_mean converge more quickly
block: make blk_abort_queue() ignore non-request based devices
block: include empty disks in /proc/diskstats
bio: use bio_kmalloc() in copy/map functions
bio: fix bio_kmalloc()
block: fix queue bounce limit setting
block: fix SG_IO vector request data length handling
scatterlist: make sure sg_miter_next() doesn't return 0 sized mappings
| -rw-r--r-- | block/blk-core.c | 6 | ||||
| -rw-r--r-- | block/blk-merge.c | 5 | ||||
| -rw-r--r-- | block/blk-settings.c | 20 | ||||
| -rw-r--r-- | block/blk-sysfs.c | 4 | ||||
| -rw-r--r-- | block/blk-timeout.c | 13 | ||||
| -rw-r--r-- | block/blk.h | 7 | ||||
| -rw-r--r-- | block/cfq-iosched.c | 66 | ||||
| -rw-r--r-- | block/genhd.c | 12 | ||||
| -rw-r--r-- | block/scsi_ioctl.c | 13 | ||||
| -rw-r--r-- | drivers/block/umem.c | 1 | ||||
| -rw-r--r-- | fs/bio.c | 124 | ||||
| -rw-r--r-- | include/linux/bio.h | 1 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 3 | ||||
| -rw-r--r-- | include/linux/genhd.h | 1 | ||||
| -rw-r--r-- | include/linux/pktcdvd.h | 1 | ||||
| -rw-r--r-- | lib/scatterlist.c | 9 |
16 files changed, 166 insertions, 120 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 07ab75403e1a..2998fe3a2377 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -643,7 +643,7 @@ static inline void blk_free_request(struct request_queue *q, struct request *rq) | |||
| 643 | } | 643 | } |
| 644 | 644 | ||
| 645 | static struct request * | 645 | static struct request * |
| 646 | blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask) | 646 | blk_alloc_request(struct request_queue *q, int flags, int priv, gfp_t gfp_mask) |
| 647 | { | 647 | { |
| 648 | struct request *rq = mempool_alloc(q->rq.rq_pool, gfp_mask); | 648 | struct request *rq = mempool_alloc(q->rq.rq_pool, gfp_mask); |
| 649 | 649 | ||
| @@ -652,7 +652,7 @@ blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask) | |||
| 652 | 652 | ||
| 653 | blk_rq_init(q, rq); | 653 | blk_rq_init(q, rq); |
| 654 | 654 | ||
| 655 | rq->cmd_flags = rw | REQ_ALLOCED; | 655 | rq->cmd_flags = flags | REQ_ALLOCED; |
| 656 | 656 | ||
| 657 | if (priv) { | 657 | if (priv) { |
| 658 | if (unlikely(elv_set_request(q, rq, gfp_mask))) { | 658 | if (unlikely(elv_set_request(q, rq, gfp_mask))) { |
| @@ -792,6 +792,8 @@ static struct request *get_request(struct request_queue *q, int rw_flags, | |||
| 792 | if (priv) | 792 | if (priv) |
| 793 | rl->elvpriv++; | 793 | rl->elvpriv++; |
| 794 | 794 | ||
| 795 | if (blk_queue_io_stat(q)) | ||
| 796 | rw_flags |= REQ_IO_STAT; | ||
| 795 | spin_unlock_irq(q->queue_lock); | 797 | spin_unlock_irq(q->queue_lock); |
| 796 | 798 | ||
| 797 | rq = blk_alloc_request(q, rw_flags, priv, gfp_mask); | 799 | rq = blk_alloc_request(q, rw_flags, priv, gfp_mask); |
diff --git a/block/blk-merge.c b/block/blk-merge.c index 63760ca3da0f..23d2a6fe34a3 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
| @@ -402,7 +402,10 @@ static int attempt_merge(struct request_queue *q, struct request *req, | |||
| 402 | 402 | ||
| 403 | elv_merge_requests(q, req, next); | 403 | elv_merge_requests(q, req, next); |
| 404 | 404 | ||
| 405 | blk_account_io_merge(req); | 405 | /* |
| 406 | * 'next' is going away, so update stats accordingly | ||
| 407 | */ | ||
| 408 | blk_account_io_merge(next); | ||
| 406 | 409 | ||
| 407 | req->ioprio = ioprio_best(req->ioprio, next->ioprio); | 410 | req->ioprio = ioprio_best(req->ioprio, next->ioprio); |
| 408 | if (blk_rq_cpu_valid(next)) | 411 | if (blk_rq_cpu_valid(next)) |
diff --git a/block/blk-settings.c b/block/blk-settings.c index 69c42adde52b..57af728d94bb 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
| @@ -156,26 +156,28 @@ EXPORT_SYMBOL(blk_queue_make_request); | |||
| 156 | 156 | ||
| 157 | /** | 157 | /** |
| 158 | * blk_queue_bounce_limit - set bounce buffer limit for queue | 158 | * blk_queue_bounce_limit - set bounce buffer limit for queue |
| 159 | * @q: the request queue for the device | 159 | * @q: the request queue for the device |
| 160 | * @dma_addr: bus address limit | 160 | * @dma_mask: the maximum address the device can handle |
| 161 | * | 161 | * |
| 162 | * Description: | 162 | * Description: |
| 163 | * Different hardware can have different requirements as to what pages | 163 | * Different hardware can have different requirements as to what pages |
| 164 | * it can do I/O directly to. A low level driver can call | 164 | * it can do I/O directly to. A low level driver can call |
| 165 | * blk_queue_bounce_limit to have lower memory pages allocated as bounce | 165 | * blk_queue_bounce_limit to have lower memory pages allocated as bounce |
| 166 | * buffers for doing I/O to pages residing above @dma_addr. | 166 | * buffers for doing I/O to pages residing above @dma_mask. |
| 167 | **/ | 167 | **/ |
| 168 | void blk_queue_bounce_limit(struct request_queue *q, u64 dma_addr) | 168 | void blk_queue_bounce_limit(struct request_queue *q, u64 dma_mask) |
| 169 | { | 169 | { |
| 170 | unsigned long b_pfn = dma_addr >> PAGE_SHIFT; | 170 | unsigned long b_pfn = dma_mask >> PAGE_SHIFT; |
| 171 | int dma = 0; | 171 | int dma = 0; |
| 172 | 172 | ||
| 173 | q->bounce_gfp = GFP_NOIO; | 173 | q->bounce_gfp = GFP_NOIO; |
| 174 | #if BITS_PER_LONG == 64 | 174 | #if BITS_PER_LONG == 64 |
| 175 | /* Assume anything <= 4GB can be handled by IOMMU. | 175 | /* |
| 176 | Actually some IOMMUs can handle everything, but I don't | 176 | * Assume anything <= 4GB can be handled by IOMMU. Actually |
| 177 | know of a way to test this here. */ | 177 | * some IOMMUs can handle everything, but I don't know of a |
| 178 | if (b_pfn < (min_t(u64, 0x100000000UL, BLK_BOUNCE_HIGH) >> PAGE_SHIFT)) | 178 | * way to test this here. |
| 179 | */ | ||
| 180 | if (b_pfn < (min_t(u64, 0xffffffffUL, BLK_BOUNCE_HIGH) >> PAGE_SHIFT)) | ||
| 179 | dma = 1; | 181 | dma = 1; |
| 180 | q->bounce_pfn = max_low_pfn; | 182 | q->bounce_pfn = max_low_pfn; |
| 181 | #else | 183 | #else |
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index cac4e9febe6a..3ff9bba3379a 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
| @@ -209,14 +209,10 @@ static ssize_t queue_iostats_store(struct request_queue *q, const char *page, | |||
| 209 | ssize_t ret = queue_var_store(&stats, page, count); | 209 | ssize_t ret = queue_var_store(&stats, page, count); |
| 210 | 210 | ||
| 211 | spin_lock_irq(q->queue_lock); | 211 | spin_lock_irq(q->queue_lock); |
| 212 | elv_quiesce_start(q); | ||
| 213 | |||
| 214 | if (stats) | 212 | if (stats) |
| 215 | queue_flag_set(QUEUE_FLAG_IO_STAT, q); | 213 | queue_flag_set(QUEUE_FLAG_IO_STAT, q); |
| 216 | else | 214 | else |
| 217 | queue_flag_clear(QUEUE_FLAG_IO_STAT, q); | 215 | queue_flag_clear(QUEUE_FLAG_IO_STAT, q); |
| 218 | |||
| 219 | elv_quiesce_end(q); | ||
| 220 | spin_unlock_irq(q->queue_lock); | 216 | spin_unlock_irq(q->queue_lock); |
| 221 | 217 | ||
| 222 | return ret; | 218 | return ret; |
diff --git a/block/blk-timeout.c b/block/blk-timeout.c index bbbdc4b8ccf2..1ec0d503cacd 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c | |||
| @@ -211,6 +211,12 @@ void blk_abort_queue(struct request_queue *q) | |||
| 211 | struct request *rq, *tmp; | 211 | struct request *rq, *tmp; |
| 212 | LIST_HEAD(list); | 212 | LIST_HEAD(list); |
| 213 | 213 | ||
| 214 | /* | ||
| 215 | * Not a request based block device, nothing to abort | ||
| 216 | */ | ||
| 217 | if (!q->request_fn) | ||
| 218 | return; | ||
| 219 | |||
| 214 | spin_lock_irqsave(q->queue_lock, flags); | 220 | spin_lock_irqsave(q->queue_lock, flags); |
| 215 | 221 | ||
| 216 | elv_abort_queue(q); | 222 | elv_abort_queue(q); |
| @@ -224,6 +230,13 @@ void blk_abort_queue(struct request_queue *q) | |||
| 224 | list_for_each_entry_safe(rq, tmp, &list, timeout_list) | 230 | list_for_each_entry_safe(rq, tmp, &list, timeout_list) |
| 225 | blk_abort_request(rq); | 231 | blk_abort_request(rq); |
| 226 | 232 | ||
| 233 | /* | ||
| 234 | * Occasionally, blk_abort_request() will return without | ||
| 235 | * deleting the element from the list. Make sure we add those back | ||
| 236 | * instead of leaving them on the local stack list. | ||
| 237 | */ | ||
| 238 | list_splice(&list, &q->timeout_list); | ||
| 239 | |||
| 227 | spin_unlock_irqrestore(q->queue_lock, flags); | 240 | spin_unlock_irqrestore(q->queue_lock, flags); |
| 228 | 241 | ||
| 229 | } | 242 | } |
diff --git a/block/blk.h b/block/blk.h index 5dfc41267a08..79c85f7c9ff5 100644 --- a/block/blk.h +++ b/block/blk.h | |||
| @@ -114,12 +114,7 @@ static inline int blk_cpu_to_group(int cpu) | |||
| 114 | 114 | ||
| 115 | static inline int blk_do_io_stat(struct request *rq) | 115 | static inline int blk_do_io_stat(struct request *rq) |
| 116 | { | 116 | { |
| 117 | struct gendisk *disk = rq->rq_disk; | 117 | return rq->rq_disk && blk_rq_io_stat(rq); |
| 118 | |||
| 119 | if (!disk || !disk->queue) | ||
| 120 | return 0; | ||
| 121 | |||
| 122 | return blk_queue_io_stat(disk->queue) && (rq->cmd_flags & REQ_ELVPRIV); | ||
| 123 | } | 118 | } |
| 124 | 119 | ||
| 125 | #endif | 120 | #endif |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 0d3b70de3d80..a55a9bd75bd1 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
| @@ -154,6 +154,8 @@ struct cfq_queue { | |||
| 154 | unsigned long rb_key; | 154 | unsigned long rb_key; |
