Commit b2cc9c19 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
 "Outside of bcache (which really isn't super big), these are all
  few-liners.  There are a few important fixes in here:

   - Fix blk pm sleeping when holding the queue lock

   - A small collection of bcache fixes that have been done and tested
     since bcache was included in this merge window.

   - A fix for a raid5 regression introduced with the bio changes.

   - Two important fixes for mtip32xx, fixing an oops and potential data
     corruption (or hang) due to wrong bio iteration on stacked devices."

* 'for-linus' of git://git.kernel.dk/linux-block:
  scatterlist: sg_set_buf() argument must be in linear mapping
  raid5: Initialize bi_vcnt
  pktcdvd: silence static checker warning
  block: remove refs to XD disks from documentation
  blkpm: avoid sleep when holding queue lock
  mtip32xx: Correctly handle bio->bi_idx != 0 conditions
  mtip32xx: Fix NULL pointer dereference during module unload
  bcache: Fix error handling in init code
  bcache: clarify free/available/unused space
  bcache: drop "select CLOSURES"
  bcache: Fix incompatible pointer type warning
parents a568fa1c ac4e97ab
...@@ -319,7 +319,10 @@ cache<0..n> ...@@ -319,7 +319,10 @@ cache<0..n>
Symlink to each of the cache devices comprising this cache set. Symlink to each of the cache devices comprising this cache set.
cache_available_percent cache_available_percent
Percentage of cache device free. Percentage of cache device which doesn't contain dirty data, and could
potentially be used for writeback. This doesn't mean this space isn't used
for clean cached data; the unused statistic (in priority_stats) is typically
much lower.
clear_stats clear_stats
Clears the statistics associated with this cache Clears the statistics associated with this cache
...@@ -423,8 +426,11 @@ nbuckets ...@@ -423,8 +426,11 @@ nbuckets
Total buckets in this cache Total buckets in this cache
priority_stats priority_stats
Statistics about how recently data in the cache has been accessed. This can Statistics about how recently data in the cache has been accessed.
reveal your working set size. This can reveal your working set size. Unused is the percentage of
the cache that doesn't contain any data. Metadata is bcache's
metadata overhead. Average is the average priority of cache buckets.
Next is a list of quantiles with the priority threshold of each.
written written
Sum of all data that has been written to the cache; comparison with Sum of all data that has been written to the cache; comparison with
......
...@@ -498,12 +498,8 @@ Your cooperation is appreciated. ...@@ -498,12 +498,8 @@ Your cooperation is appreciated.
Each device type has 5 bits (32 minors). Each device type has 5 bits (32 minors).
13 block 8-bit MFM/RLL/IDE controller 13 block Previously used for the XT disk (/dev/xdN)
0 = /dev/xda First XT disk whole disk Deleted in kernel v3.9.
64 = /dev/xdb Second XT disk whole disk
Partitions are handled in the same way as IDE disks
(see major number 3).
14 char Open Sound System (OSS) 14 char Open Sound System (OSS)
0 = /dev/mixer Mixer control 0 = /dev/mixer Mixer control
......
...@@ -3351,9 +3351,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -3351,9 +3351,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
plus one apbt timer for broadcast timer. plus one apbt timer for broadcast timer.
x86_mrst_timer=apbt_only | lapic_and_apbt x86_mrst_timer=apbt_only | lapic_and_apbt
xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks.
xd_geo= See header of drivers/block/xd.c.
xen_emul_unplug= [HW,X86,XEN] xen_emul_unplug= [HW,X86,XEN]
Unplug Xen emulated devices Unplug Xen emulated devices
Format: [unplug0,][unplug1] Format: [unplug0,][unplug1]
......
...@@ -80,8 +80,6 @@ Valid names are: ...@@ -80,8 +80,6 @@ Valid names are:
/dev/sdd: -> 0x0830 (forth SCSI disk) /dev/sdd: -> 0x0830 (forth SCSI disk)
/dev/sde: -> 0x0840 (fifth SCSI disk) /dev/sde: -> 0x0840 (fifth SCSI disk)
/dev/fd : -> 0x0200 (floppy disk) /dev/fd : -> 0x0200 (floppy disk)
/dev/xda: -> 0x0c00 (first XT disk, unused in Linux/m68k)
/dev/xdb: -> 0x0c40 (second XT disk, unused in Linux/m68k)
The name must be followed by a decimal number, that stands for the The name must be followed by a decimal number, that stands for the
partition number. Internally, the value of the number is just partition number. Internally, the value of the number is just
......
...@@ -3164,7 +3164,7 @@ void blk_post_runtime_resume(struct request_queue *q, int err) ...@@ -3164,7 +3164,7 @@ void blk_post_runtime_resume(struct request_queue *q, int err)
q->rpm_status = RPM_ACTIVE; q->rpm_status = RPM_ACTIVE;
__blk_run_queue(q); __blk_run_queue(q);
pm_runtime_mark_last_busy(q->dev); pm_runtime_mark_last_busy(q->dev);
pm_runtime_autosuspend(q->dev); pm_request_autosuspend(q->dev);
} else { } else {
q->rpm_status = RPM_SUSPENDED; q->rpm_status = RPM_SUSPENDED;
} }
......
...@@ -3002,6 +3002,7 @@ static int mtip_hw_debugfs_init(struct driver_data *dd) ...@@ -3002,6 +3002,7 @@ static int mtip_hw_debugfs_init(struct driver_data *dd)
static void mtip_hw_debugfs_exit(struct driver_data *dd) static void mtip_hw_debugfs_exit(struct driver_data *dd)
{ {
if (dd->dfs_node)
debugfs_remove_recursive(dd->dfs_node); debugfs_remove_recursive(dd->dfs_node);
} }
...@@ -3863,7 +3864,7 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio) ...@@ -3863,7 +3864,7 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio)
struct driver_data *dd = queue->queuedata; struct driver_data *dd = queue->queuedata;
struct scatterlist *sg; struct scatterlist *sg;
struct bio_vec *bvec; struct bio_vec *bvec;
int nents = 0; int i, nents = 0;
int tag = 0, unaligned = 0; int tag = 0, unaligned = 0;
if (unlikely(dd->dd_flag & MTIP_DDF_STOP_IO)) { if (unlikely(dd->dd_flag & MTIP_DDF_STOP_IO)) {
...@@ -3921,11 +3922,12 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio) ...@@ -3921,11 +3922,12 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio)
} }
/* Create the scatter list for this bio. */ /* Create the scatter list for this bio. */
bio_for_each_segment(bvec, bio, nents) { bio_for_each_segment(bvec, bio, i) {
sg_set_page(&sg[nents], sg_set_page(&sg[nents],
bvec->bv_page, bvec->bv_page,
bvec->bv_len, bvec->bv_len,
bvec->bv_offset); bvec->bv_offset);
nents++;
} }
/* Issue the read/write. */ /* Issue the read/write. */
......
...@@ -83,7 +83,8 @@ ...@@ -83,7 +83,8 @@
#define MAX_SPEED 0xffff #define MAX_SPEED 0xffff
#define ZONE(sector, pd) (((sector) + (pd)->offset) & ~((pd)->settings.size - 1)) #define ZONE(sector, pd) (((sector) + (pd)->offset) & \
~(sector_t)((pd)->settings.size - 1))
static DEFINE_MUTEX(pktcdvd_mutex); static DEFINE_MUTEX(pktcdvd_mutex);
static struct pktcdvd_device *pkt_devs[MAX_WRITERS]; static struct pktcdvd_device *pkt_devs[MAX_WRITERS];
......
config BCACHE config BCACHE
tristate "Block device as cache" tristate "Block device as cache"
select CLOSURES
---help--- ---help---
Allows a block device to be used as cache for other devices; uses Allows a block device to be used as cache for other devices; uses
a btree for indexing and the layout is optimized for SSDs. a btree for indexing and the layout is optimized for SSDs.
......
...@@ -1241,7 +1241,7 @@ void bch_cache_set_stop(struct cache_set *); ...@@ -1241,7 +1241,7 @@ void bch_cache_set_stop(struct cache_set *);
struct cache_set *bch_cache_set_alloc(struct cache_sb *); struct cache_set *bch_cache_set_alloc(struct cache_sb *);
void bch_btree_cache_free(struct cache_set *); void bch_btree_cache_free(struct cache_set *);
int bch_btree_cache_alloc(struct cache_set *); int bch_btree_cache_alloc(struct cache_set *);
void bch_writeback_init_cached_dev(struct cached_dev *); void bch_cached_dev_writeback_init(struct cached_dev *);
void bch_moving_init_cache_set(struct cache_set *); void bch_moving_init_cache_set(struct cache_set *);
void bch_cache_allocator_exit(struct cache *ca); void bch_cache_allocator_exit(struct cache *ca);
......
...@@ -93,24 +93,6 @@ static struct attribute *bch_stats_files[] = { ...@@ -93,24 +93,6 @@ static struct attribute *bch_stats_files[] = {
}; };
static KTYPE(bch_stats); static KTYPE(bch_stats);
static void scale_accounting(unsigned long data);
void bch_cache_accounting_init(struct cache_accounting *acc,
struct closure *parent)
{
kobject_init(&acc->total.kobj, &bch_stats_ktype);
kobject_init(&acc->five_minute.kobj, &bch_stats_ktype);
kobject_init(&acc->hour.kobj, &bch_stats_ktype);
kobject_init(&acc->day.kobj, &bch_stats_ktype);
closure_init(&acc->cl, parent);
init_timer(&acc->timer);
acc->timer.expires = jiffies + accounting_delay;
acc->timer.data = (unsigned long) acc;
acc->timer.function = scale_accounting;
add_timer(&acc->timer);
}
int bch_cache_accounting_add_kobjs(struct cache_accounting *acc, int bch_cache_accounting_add_kobjs(struct cache_accounting *acc,
struct kobject *parent) struct kobject *parent)
{ {
...@@ -244,3 +226,19 @@ void bch_mark_sectors_bypassed(struct search *s, int sectors) ...@@ -244,3 +226,19 @@ void bch_mark_sectors_bypassed(struct search *s, int sectors)
atomic_add(sectors, &dc->accounting.collector.sectors_bypassed); atomic_add(sectors, &dc->accounting.collector.sectors_bypassed);
atomic_add(sectors, &s->op.c->accounting.collector.sectors_bypassed); atomic_add(sectors, &s->op.c->accounting.collector.sectors_bypassed);
} }
void bch_cache_accounting_init(struct cache_accounting *acc,
struct closure *parent)
{
kobject_init(&acc->total.kobj, &bch_stats_ktype);
kobject_init(&acc->five_minute.kobj, &bch_stats_ktype);
kobject_init(&acc->hour.kobj, &bch_stats_ktype);
kobject_init(&acc->day.kobj, &bch_stats_ktype);
closure_init(&acc->cl, parent);
init_timer(&acc->timer);
acc->timer.expires = jiffies + accounting_delay;
acc->timer.data = (unsigned long) acc;
acc->timer.function = scale_accounting;
add_timer(&acc->timer);
}
This diff is collapsed.
...@@ -375,7 +375,7 @@ static void read_dirty(struct closure *cl) ...@@ -375,7 +375,7 @@ static void read_dirty(struct closure *cl)
refill_dirty(cl); refill_dirty(cl);
} }
void bch_writeback_init_cached_dev(struct cached_dev *dc) void bch_cached_dev_writeback_init(struct cached_dev *dc)
{ {
closure_init_unlocked(&dc->writeback); closure_init_unlocked(&dc->writeback);
init_rwsem(&dc->writeback_lock); init_rwsem(&dc->writeback_lock);
......
...@@ -664,6 +664,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) ...@@ -664,6 +664,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
if (test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) if (test_bit(R5_ReadNoMerge, &sh->dev[i].flags))
bi->bi_rw |= REQ_FLUSH; bi->bi_rw |= REQ_FLUSH;
bi->bi_vcnt = 1;
bi->bi_io_vec[0].bv_len = STRIPE_SIZE; bi->bi_io_vec[0].bv_len = STRIPE_SIZE;
bi->bi_io_vec[0].bv_offset = 0; bi->bi_io_vec[0].bv_offset = 0;
bi->bi_size = STRIPE_SIZE; bi->bi_size = STRIPE_SIZE;
...@@ -701,6 +702,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) ...@@ -701,6 +702,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
else else
rbi->bi_sector = (sh->sector rbi->bi_sector = (sh->sector
+ rrdev->data_offset); + rrdev->data_offset);
rbi->bi_vcnt = 1;
rbi->bi_io_vec[0].bv_len = STRIPE_SIZE; rbi->bi_io_vec[0].bv_len = STRIPE_SIZE;
rbi->bi_io_vec[0].bv_offset = 0; rbi->bi_io_vec[0].bv_offset = 0;
rbi->bi_size = STRIPE_SIZE; rbi->bi_size = STRIPE_SIZE;
......
...@@ -111,6 +111,9 @@ static inline struct page *sg_page(struct scatterlist *sg) ...@@ -111,6 +111,9 @@ static inline struct page *sg_page(struct scatterlist *sg)
static inline void sg_set_buf(struct scatterlist *sg, const void *buf, static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
unsigned int buflen) unsigned int buflen)
{ {
#ifdef CONFIG_DEBUG_SG
BUG_ON(!virt_addr_valid(buf));
#endif
sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
} }
......
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