diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 22:08:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 22:08:14 -0500 |
commit | 0910c0bdf7c291a41bc21e40a97389c9d4c1960d (patch) | |
tree | 177c4cb22ece78b18f64f548ae82b9a15edbb99c /fs | |
parent | 2821fe6b00a1e902fd399bb4b7e40bc3041f4d44 (diff) | |
parent | e37459b8e2c7db6735e39e019e448b76e5e77647 (diff) |
Merge branch 'for-3.13/core' of git://git.kernel.dk/linux-block
Pull block IO core updates from Jens Axboe:
"This is the pull request for the core changes in the block layer for
3.13. It contains:
- The new blk-mq request interface.
This is a new and more scalable queueing model that marries the
best part of the request based interface we currently have (which
is fully featured, but scales poorly) and the bio based "interface"
which the new drivers for high IOPS devices end up using because
it's much faster than the request based one.
The bio interface has no block layer support, since it taps into
the stack much earlier. This means that drivers end up having to
implement a lot of functionality on their own, like tagging,
timeout handling, requeue, etc. The blk-mq interface provides all
these. Some drivers even provide a switch to select bio or rq and
has code to handle both, since things like merging only works in
the rq model and hence is faster for some workloads. This is a
huge mess. Conversion of these drivers nets us a substantial code
reduction. Initial results on converting SCSI to this model even
shows an 8x improvement on single queue devices. So while the
model was intended to work on the newer multiqueue devices, it has
substantial improvements for "classic" hardware as well. This code
has gone through extensive testing and development, it's now ready
to go. A pull request is coming to convert virtio-blk to this
model will be will be coming as well, with more drivers scheduled
for 3.14 conversion.
- Two blktrace fixes from Jan and Chen Gang.
- A plug merge fix from Alireza Haghdoost.
- Conversion of __get_cpu_var() from Christoph Lameter.
- Fix for sector_div() with 64-bit divider from Geert Uytterhoeven.
- A fix for a race between request completion and the timeout
handling from Jeff Moyer. This is what caused the merge conflict
with blk-mq/core, in case you are looking at that.
- A dm stacking fix from Mike Snitzer.
- A code consolidation fix and duplicated code removal from Kent
Overstreet.
- A handful of block bug fixes from Mikulas Patocka, fixing a loop
crash and memory corruption on blk cg.
- Elevator switch bug fix from Tomoki Sekiyama.
A heads-up that I had to rebase this branch. Initially the immutable
bio_vecs had been queued up for inclusion, but a week later, it became
clear that it wasn't fully cooked yet. So the decision was made to
pull this out and postpone it until 3.14. It was a straight forward
rebase, just pruning out the immutable series and the later fixes of
problems with it. The rest of the patches applied directly and no
further changes were made"
* 'for-3.13/core' of git://git.kernel.dk/linux-block: (31 commits)
block: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
block: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
block: Do not call sector_div() with a 64-bit divisor
kernel: trace: blktrace: remove redundent memcpy() in compat_blk_trace_setup()
block: Consolidate duplicated bio_trim() implementations
block: Use rw_copy_check_uvector()
block: Enable sysfs nomerge control for I/O requests in the plug list
block: properly stack underlying max_segment_size to DM device
elevator: acquire q->sysfs_lock in elevator_change()
elevator: Fix a race in elevator switching and md device initialization
block: Replace __get_cpu_var uses
bdi: test bdi_init failure
block: fix a probe argument to blk_register_region
loop: fix crash if blk_alloc_queue fails
blk-core: Fix memory corruption if blkcg_init_queue fails
block: fix race between request completion and timeout handling
blktrace: Send BLK_TN_PROCESS events to all running traces
blk-mq: don't disallow request merges for req->special being set
blk-mq: mq plug list breakage
blk-mq: fix for flush deadlock
...
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio.c | 46 | ||||
-rw-r--r-- | fs/char_dev.c | 3 | ||||
-rw-r--r-- | fs/fscache/object.c | 2 |
3 files changed, 49 insertions, 2 deletions
@@ -1805,6 +1805,52 @@ struct bio_pair *bio_split(struct bio *bi, int first_sectors) | |||
1805 | EXPORT_SYMBOL(bio_split); | 1805 | EXPORT_SYMBOL(bio_split); |
1806 | 1806 | ||
1807 | /** | 1807 | /** |
1808 | * bio_trim - trim a bio | ||
1809 | * @bio: bio to trim | ||
1810 | * @offset: number of sectors to trim from the front of @bio | ||
1811 | * @size: size we want to trim @bio to, in sectors | ||
1812 | */ | ||
1813 | void bio_trim(struct bio *bio, int offset, int size) | ||
1814 | { | ||
1815 | /* 'bio' is a cloned bio which we need to trim to match | ||
1816 | * the given offset and size. | ||
1817 | * This requires adjusting bi_sector, bi_size, and bi_io_vec | ||
1818 | */ | ||
1819 | int i; | ||
1820 | struct bio_vec *bvec; | ||
1821 | int sofar = 0; | ||
1822 | |||
1823 | size <<= 9; | ||
1824 | if (offset == 0 && size == bio->bi_size) | ||
1825 | return; | ||
1826 | |||
1827 | clear_bit(BIO_SEG_VALID, &bio->bi_flags); | ||
1828 | |||
1829 | bio_advance(bio, offset << 9); | ||
1830 | |||
1831 | bio->bi_size = size; | ||
1832 | |||
1833 | /* avoid any complications with bi_idx being non-zero*/ | ||
1834 | if (bio->bi_idx) { | ||
1835 | memmove(bio->bi_io_vec, bio->bi_io_vec+bio->bi_idx, | ||
1836 | (bio->bi_vcnt - bio->bi_idx) * sizeof(struct bio_vec)); | ||
1837 | bio->bi_vcnt -= bio->bi_idx; | ||
1838 | bio->bi_idx = 0; | ||
1839 | } | ||
1840 | /* Make sure vcnt and last bv are not too big */ | ||
1841 | bio_for_each_segment(bvec, bio, i) { | ||
1842 | if (sofar + bvec->bv_len > size) | ||
1843 | bvec->bv_len = size - sofar; | ||
1844 | if (bvec->bv_len == 0) { | ||
1845 | bio->bi_vcnt = i; | ||
1846 | break; | ||
1847 | } | ||
1848 | sofar += bvec->bv_len; | ||
1849 | } | ||
1850 | } | ||
1851 | EXPORT_SYMBOL_GPL(bio_trim); | ||
1852 | |||
1853 | /** | ||
1808 | * bio_sector_offset - Find hardware sector offset in bio | 1854 | * bio_sector_offset - Find hardware sector offset in bio |
1809 | * @bio: bio to inspect | 1855 | * @bio: bio to inspect |
1810 | * @index: bio_vec index | 1856 | * @index: bio_vec index |
diff --git a/fs/char_dev.c b/fs/char_dev.c index 94b5f60076da..f77f7702fabe 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c | |||
@@ -576,7 +576,8 @@ static struct kobject *base_probe(dev_t dev, int *part, void *data) | |||
576 | void __init chrdev_init(void) | 576 | void __init chrdev_init(void) |
577 | { | 577 | { |
578 | cdev_map = kobj_map_init(base_probe, &chrdevs_lock); | 578 | cdev_map = kobj_map_init(base_probe, &chrdevs_lock); |
579 | bdi_init(&directly_mappable_cdev_bdi); | 579 | if (bdi_init(&directly_mappable_cdev_bdi)) |
580 | panic("Failed to init directly mappable cdev bdi"); | ||
580 | } | 581 | } |
581 | 582 | ||
582 | 583 | ||
diff --git a/fs/fscache/object.c b/fs/fscache/object.c index dcb821617774..53d35c504240 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c | |||
@@ -799,7 +799,7 @@ void fscache_enqueue_object(struct fscache_object *object) | |||
799 | */ | 799 | */ |
800 | bool fscache_object_sleep_till_congested(signed long *timeoutp) | 800 | bool fscache_object_sleep_till_congested(signed long *timeoutp) |
801 | { | 801 | { |
802 | wait_queue_head_t *cong_wq = &__get_cpu_var(fscache_object_cong_wait); | 802 | wait_queue_head_t *cong_wq = this_cpu_ptr(&fscache_object_cong_wait); |
803 | DEFINE_WAIT(wait); | 803 | DEFINE_WAIT(wait); |
804 | 804 | ||
805 | if (fscache_object_congested()) | 805 | if (fscache_object_congested()) |