* [PATCH 01/15] bcache: Avoid nested function definition
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 02/15] bcache: check ca->alloc_thread initialized before wake up it Michael Lyle
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Peter Foley
From: Peter Foley <pefoley2@pefoley.com>
Fixes below error with clang:
../drivers/md/bcache/sysfs.c:759:3: error: function definition is not allowed here
{ return *((uint16_t *) r) - *((uint16_t *) l); }
^
../drivers/md/bcache/sysfs.c:789:32: error: use of undeclared identifier 'cmp'
sort(p, n, sizeof(uint16_t), cmp, NULL);
^
2 errors generated.
v2:
rename function to __bch_cache_cmp
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Reviewed-by: Coly Li <colyli@suse.de>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
---
drivers/md/bcache/sysfs.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 104c57cd666c..69f355b9650c 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -745,6 +745,11 @@ static struct attribute *bch_cache_set_internal_files[] = {
};
KTYPE(bch_cache_set_internal);
+static int __bch_cache_cmp(const void *l, const void *r)
+{
+ return *((uint16_t *)r) - *((uint16_t *)l);
+}
+
SHOW(__bch_cache)
{
struct cache *ca = container_of(kobj, struct cache, kobj);
@@ -769,9 +774,6 @@ SHOW(__bch_cache)
CACHE_REPLACEMENT(&ca->sb));
if (attr == &sysfs_priority_stats) {
- int cmp(const void *l, const void *r)
- { return *((uint16_t *) r) - *((uint16_t *) l); }
-
struct bucket *b;
size_t n = ca->sb.nbuckets, i;
size_t unused = 0, available = 0, dirty = 0, meta = 0;
@@ -800,7 +802,7 @@ SHOW(__bch_cache)
p[i] = ca->buckets[i].prio;
mutex_unlock(&ca->set->bucket_lock);
- sort(p, n, sizeof(uint16_t), cmp, NULL);
+ sort(p, n, sizeof(uint16_t), __bch_cache_cmp, NULL);
while (n &&
!cached[n - 1])
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 02/15] bcache: check ca->alloc_thread initialized before wake up it
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
2017-10-13 23:35 ` [PATCH 01/15] bcache: Avoid nested function definition Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 03/15] bcache: fix a comments typo in bch_alloc_sectors() Michael Lyle
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Coly Li, Kent Overstreet, stable
From: Coly Li <colyli@suse.de>
In bcache code, sysfs entries are created before all resources get
allocated, e.g. allocation thread of a cache set.
There is posibility for NULL pointer deference if a resource is accessed
but which is not initialized yet. Indeed Jorg Bornschein catches one on
cache set allocation thread and gets a kernel oops.
The reason for this bug is, when bch_bucket_alloc() is called during
cache set registration and attaching, ca->alloc_thread is not properly
allocated and initialized yet, call wake_up_process() on ca->alloc_thread
triggers NULL pointer deference failure. A simple and fast fix is, before
waking up ca->alloc_thread, checking whether it is allocated, and only
wake up ca->alloc_thread when it is not NULL.
Signed-off-by: Coly Li <colyli@suse.de>
Reported-by: Jorg Bornschein <jb@capsec.org>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Michael Lyle <mlyle@lyle.org>
---
drivers/md/bcache/alloc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index cacbe2dbd5c3..e1a4205caa2e 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -406,7 +406,8 @@ long bch_bucket_alloc(struct cache *ca, unsigned reserve, bool wait)
finish_wait(&ca->set->bucket_wait, &w);
out:
- wake_up_process(ca->alloc_thread);
+ if (ca->alloc_thread)
+ wake_up_process(ca->alloc_thread);
trace_bcache_alloc(ca, reserve);
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 03/15] bcache: fix a comments typo in bch_alloc_sectors()
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
2017-10-13 23:35 ` [PATCH 01/15] bcache: Avoid nested function definition Michael Lyle
2017-10-13 23:35 ` [PATCH 02/15] bcache: check ca->alloc_thread initialized before wake up it Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 04/15] bcache: rewrite multiple partitions support Michael Lyle
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Coly Li
From: Coly Li <colyli@suse.de>
Code comments in alloc.c:bch_alloc_sectors() mentions a function
name find_data_bucket(), the correct function name should be
pick_data_bucket() indeed. bch_alloc_sectors() is a quite important
function in bcache allocation code, fixing the typo may help
other people to have less confusion.
Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Tang Junhui <tang.junhui@zte.com.cn>
---
drivers/md/bcache/alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index e1a4205caa2e..4c40870e99f5 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -601,7 +601,7 @@ bool bch_alloc_sectors(struct cache_set *c, struct bkey *k, unsigned sectors,
/*
* If we had to allocate, we might race and not need to allocate the
- * second time we call find_data_bucket(). If we allocated a bucket but
+ * second time we call pick_data_bucket(). If we allocated a bucket but
* didn't use it, drop the refcount bch_bucket_alloc_set() took:
*/
if (KEY_PTRS(&alloc.key))
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 04/15] bcache: rewrite multiple partitions support
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (2 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 03/15] bcache: fix a comments typo in bch_alloc_sectors() Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 05/15] bcache: Remove redundant set_capacity Michael Lyle
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block
Cc: axboe, Coly Li, Eric Wheeler, Junhui Tang, Michael Lyle
From: Coly Li <colyli@suse.de>
Current partition support of bcache is confusing and buggy. It tries to
trace non-continuous device minor numbers by an ida bit string, and
mistakenly mixed bcache device index with minor numbers. This design
generates several negative results,
- Index of bcache device name is not consecutive under /dev/. If there are
3 bcache devices, they name will be,
/dev/bcache0, /dev/bcache16, /dev/bcache32
Only bcache code indexes bcache device name is such an interesting way.
- First minor number of each bcache device is traced by ida bit string.
One bcache device will occupy 16 bits, this is not a good idea. Indeed
only one bit is enough.
- Because minor number and bcache device index are mixed, a device index
is allocated by ida_simple_get(), but an first minor number is sent into
ida_simple_remove() to release the device. It confused original author
too.
Root cause of the above errors is, bcache code should not handle device
minor numbers at all! A standard process to support multiple partitions in
Linux kernel is,
- Device driver provides major device number, and indexes multiple device
instances.
- Device driver does not allocat nor trace device minor number, only
provides a first minor number of a given device instance, and sets how
many minor numbers (paritions) the device instance may have.
All rested stuffs are handled by block layer code, most of the details can
be found from block/{genhd, partition-generic}.c files.
This patch re-writes multiple partitions support for bcache. It makes
whole things to be more clear, and uses ida bit string in a more efficeint
way.
- Ida bit string only traces bcache device index, not minor number. For a
bcache device with 128 partitions, only one bit in ida bit string is
enough.
- Device minor number and device index are separated in concept. Device
index is used for /dev node naming, and ida bit string trace. Minor
number is calculated from device index and only used to initialize
first_minor of a bcache device.
- It does not follow any standard for 16 partitions on a bcache device.
This patch sets 128 partitions on single bcache device at max, this is
the limitation from GPT (GUID Partition Table) and supported by fdisk.
Considering a typical device minor number is 20 bits width, each bcache
device may have 128 partitions (7 bits), there can be 8192 bcache devices
existing on system. For most common deployment for a single server in
now days, it should be enough.
[minor spelling fixes in commit message by Michael Lyle]
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Eric Wheeler <bcache@lists.ewheeler.net>
Cc: Junhui Tang <tang.junhui@zte.com.cn>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Michael Lyle <mlyle@lyle.org>
---
drivers/md/bcache/super.c | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index fc0a31b13ac4..a478d1ac0480 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -53,12 +53,15 @@ LIST_HEAD(bch_cache_sets);
static LIST_HEAD(uncached_devices);
static int bcache_major;
-static DEFINE_IDA(bcache_minor);
+static DEFINE_IDA(bcache_device_idx);
static wait_queue_head_t unregister_wait;
struct workqueue_struct *bcache_wq;
#define BTREE_MAX_PAGES (256 * 1024 / PAGE_SIZE)
-#define BCACHE_MINORS 16 /* partition support */
+/* limitation of partitions number on single bcache device */
+#define BCACHE_MINORS 128
+/* limitation of bcache devices number on single system */
+#define BCACHE_DEVICE_IDX_MAX ((1U << MINORBITS)/BCACHE_MINORS)
/* Superblock */
@@ -721,6 +724,16 @@ static void bcache_device_attach(struct bcache_device *d, struct cache_set *c,
closure_get(&c->caching);
}
+static inline int first_minor_to_idx(int first_minor)
+{
+ return (first_minor/BCACHE_MINORS);
+}
+
+static inline int idx_to_first_minor(int idx)
+{
+ return (idx * BCACHE_MINORS);
+}
+
static void bcache_device_free(struct bcache_device *d)
{
lockdep_assert_held(&bch_register_lock);
@@ -734,7 +747,8 @@ static void bcache_device_free(struct bcache_device *d)
if (d->disk && d->disk->queue)
blk_cleanup_queue(d->disk->queue);
if (d->disk) {
- ida_simple_remove(&bcache_minor, d->disk->first_minor);
+ ida_simple_remove(&bcache_device_idx,
+ first_minor_to_idx(d->disk->first_minor));
put_disk(d->disk);
}
@@ -751,7 +765,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
{
struct request_queue *q;
size_t n;
- int minor;
+ int idx;
if (!d->stripe_size)
d->stripe_size = 1 << 31;
@@ -776,25 +790,24 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
if (!d->full_dirty_stripes)
return -ENOMEM;
- minor = ida_simple_get(&bcache_minor, 0, MINORMASK + 1, GFP_KERNEL);
- if (minor < 0)
- return minor;
-
- minor *= BCACHE_MINORS;
+ idx = ida_simple_get(&bcache_device_idx, 0,
+ BCACHE_DEVICE_IDX_MAX, GFP_KERNEL);
+ if (idx < 0)
+ return idx;
if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio),
BIOSET_NEED_BVECS |
BIOSET_NEED_RESCUER)) ||
!(d->disk = alloc_disk(BCACHE_MINORS))) {
- ida_simple_remove(&bcache_minor, minor);
+ ida_simple_remove(&bcache_device_idx, idx);
return -ENOMEM;
}
set_capacity(d->disk, sectors);
- snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor);
+ snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", idx);
d->disk->major = bcache_major;
- d->disk->first_minor = minor;
+ d->disk->first_minor = idx_to_first_minor(idx);
d->disk->fops = &bcache_ops;
d->disk->private_data = d;
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 05/15] bcache: Remove redundant set_capacity
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (3 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 04/15] bcache: rewrite multiple partitions support Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 06/15] bcache: update bio->bi_opf bypass/writeback REQ_ flag hints Michael Lyle
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Yijing Wang
From: Yijing Wang <wangyijing@huawei.com>
set_capacity() has been called in bcache_device_init(),
remove the redundant one.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Reviewed-by: Eric Wheeler <bcache@linux.ewheeler.net>
Acked-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/super.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index a478d1ac0480..72c3b2929ef0 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1142,9 +1142,6 @@ static int cached_dev_init(struct cached_dev *dc, unsigned block_size)
if (ret)
return ret;
- set_capacity(dc->disk.disk,
- dc->bdev->bd_part->nr_sects - dc->sb.data_offset);
-
dc->disk.disk->queue->backing_dev_info->ra_pages =
max(dc->disk.disk->queue->backing_dev_info->ra_pages,
q->backing_dev_info->ra_pages);
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 06/15] bcache: update bio->bi_opf bypass/writeback REQ_ flag hints
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (4 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 05/15] bcache: Remove redundant set_capacity Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 07/15] bcache: remove unused parameter Michael Lyle
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Eric Wheeler
From: Eric Wheeler <bcache@linux.ewheeler.net>
Flag for bypass if the IO is for read-ahead or background, unless the
read-ahead request is for metadata (eg, from gfs2).
Bypass if:
bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) &&
!(bio->bi_opf & REQ_META))
Writeback if:
op_is_sync(bio->bi_opf) ||
bio->bi_opf & (REQ_META|REQ_PRIO)
Signed-off-by: Eric Wheeler <bcache@linux.ewheeler.net>
Reviewed-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/request.c | 8 ++++++++
drivers/md/bcache/writeback.h | 4 +++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 681b4f12b05a..9ee137e8d387 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -384,6 +384,14 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
op_is_write(bio_op(bio))))
goto skip;
+ /*
+ * Flag for bypass if the IO is for read-ahead or background,
+ * unless the read-ahead request is for metadata (eg, for gfs2).
+ */
+ if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) &&
+ !(bio->bi_opf & REQ_META))
+ goto skip;
+
if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) ||
bio_sectors(bio) & (c->sb.block_size - 1)) {
pr_debug("skipping unaligned io");
diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h
index e35421d20d2e..34bcf49d737b 100644
--- a/drivers/md/bcache/writeback.h
+++ b/drivers/md/bcache/writeback.h
@@ -76,7 +76,9 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio,
if (would_skip)
return false;
- return op_is_sync(bio->bi_opf) || in_use <= CUTOFF_WRITEBACK;
+ return (op_is_sync(bio->bi_opf) ||
+ bio->bi_opf & (REQ_META|REQ_PRIO) ||
+ in_use <= CUTOFF_WRITEBACK);
}
static inline void bch_writeback_queue(struct cached_dev *dc)
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 07/15] bcache: remove unused parameter
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (5 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 06/15] bcache: update bio->bi_opf bypass/writeback REQ_ flag hints Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 08/15] bcache: don't write back data if reading it failed Michael Lyle
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Yijing Wang
From: Yijing Wang <wangyijing@huawei.com>
Parameter bio is no longer used, clean it.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Reviewed-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/request.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 9ee137e8d387..163a17a80874 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -26,12 +26,12 @@ struct kmem_cache *bch_search_cache;
static void bch_data_insert_start(struct closure *);
-static unsigned cache_mode(struct cached_dev *dc, struct bio *bio)
+static unsigned cache_mode(struct cached_dev *dc)
{
return BDEV_CACHE_MODE(&dc->sb);
}
-static bool verify(struct cached_dev *dc, struct bio *bio)
+static bool verify(struct cached_dev *dc)
{
return dc->verify;
}
@@ -369,7 +369,7 @@ static struct hlist_head *iohash(struct cached_dev *dc, uint64_t k)
static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
{
struct cache_set *c = dc->disk.c;
- unsigned mode = cache_mode(dc, bio);
+ unsigned mode = cache_mode(dc);
unsigned sectors, congested = bch_get_congested(c);
struct task_struct *task = current;
struct io *i;
@@ -747,7 +747,7 @@ static void cached_dev_read_done(struct closure *cl)
s->cache_miss = NULL;
}
- if (verify(dc, &s->bio.bio) && s->recoverable && !s->read_dirty_data)
+ if (verify(dc) && s->recoverable && !s->read_dirty_data)
bch_data_verify(dc, s->orig_bio);
bio_complete(s);
@@ -772,7 +772,7 @@ static void cached_dev_read_done_bh(struct closure *cl)
if (s->iop.status)
continue_at_nobarrier(cl, cached_dev_read_error, bcache_wq);
- else if (s->iop.bio || verify(dc, &s->bio.bio))
+ else if (s->iop.bio || verify(dc))
continue_at_nobarrier(cl, cached_dev_read_done, bcache_wq);
else
continue_at_nobarrier(cl, cached_dev_bio_complete, NULL);
@@ -899,7 +899,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s)
s->iop.bypass = true;
if (should_writeback(dc, s->orig_bio,
- cache_mode(dc, bio),
+ cache_mode(dc),
s->iop.bypass)) {
s->iop.bypass = false;
s->iop.writeback = true;
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 08/15] bcache: don't write back data if reading it failed
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (6 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 07/15] bcache: remove unused parameter Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 09/15] bcache: implement PI controller for writeback rate Michael Lyle
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Michael Lyle
If an IO operation fails, and we didn't successfully read data from the
cache, don't writeback invalid/partial data to the backing disk.
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/writeback.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index e663ca082183..5e65a392287d 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -179,13 +179,21 @@ static void write_dirty(struct closure *cl)
struct dirty_io *io = container_of(cl, struct dirty_io, cl);
struct keybuf_key *w = io->bio.bi_private;
- dirty_init(w);
- bio_set_op_attrs(&io->bio, REQ_OP_WRITE, 0);
- io->bio.bi_iter.bi_sector = KEY_START(&w->key);
- bio_set_dev(&io->bio, io->dc->bdev);
- io->bio.bi_end_io = dirty_endio;
+ /*
+ * IO errors are signalled using the dirty bit on the key.
+ * If we failed to read, we should not attempt to write to the
+ * backing device. Instead, immediately go to write_dirty_finish
+ * to clean up.
+ */
+ if (KEY_DIRTY(&w->key)) {
+ dirty_init(w);
+ bio_set_op_attrs(&io->bio, REQ_OP_WRITE, 0);
+ io->bio.bi_iter.bi_sector = KEY_START(&w->key);
+ bio_set_dev(&io->bio, io->dc->bdev);
+ io->bio.bi_end_io = dirty_endio;
- closure_bio_submit(&io->bio, cl);
+ closure_bio_submit(&io->bio, cl);
+ }
continue_at(cl, write_dirty_finish, io->dc->writeback_write_wq);
}
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 09/15] bcache: implement PI controller for writeback rate
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (7 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 08/15] bcache: don't write back data if reading it failed Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 10/15] bcache: smooth writeback rate control Michael Lyle
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Michael Lyle
bcache uses a control system to attempt to keep the amount of dirty data
in cache at a user-configured level, while not responding excessively to
transients and variations in write rate. Previously, the system was a
PD controller; but the output from it was integrated, turning the
Proportional term into an Integral term, and turning the Derivative term
into a crude Proportional term. Performance of the controller has been
uneven in production, and it has tended to respond slowly, oscillate,
and overshoot.
This patch set replaces the current control system with an explicit PI
controller and tuning that should be correct for most hardware. By
default, it attempts to write at a rate that would retire 1/40th of the
current excess blocks per second. An integral term in turn works to
remove steady state errors.
IMO, this yields benefits in simplicity (removing weighted average
filtering, etc) and system performance.
Another small change is a tunable parameter is introduced to allow the
user to specify a minimum rate at which dirty blocks are retired.
There is a slight difference from earlier versions of the patch in
integral handling to prevent excessive negative integral windup.
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/bcache.h | 9 ++---
drivers/md/bcache/sysfs.c | 18 +++++----
drivers/md/bcache/writeback.c | 91 ++++++++++++++++++++++++-------------------
3 files changed, 66 insertions(+), 52 deletions(-)
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 2ed9bd231d84..eb83be693d60 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -265,9 +265,6 @@ struct bcache_device {
atomic_t *stripe_sectors_dirty;
unsigned long *full_dirty_stripes;
- unsigned long sectors_dirty_last;
- long sectors_dirty_derivative;
-
struct bio_set *bio_split;
unsigned data_csum:1;
@@ -362,12 +359,14 @@ struct cached_dev {
uint64_t writeback_rate_target;
int64_t writeback_rate_proportional;
- int64_t writeback_rate_derivative;
+ int64_t writeback_rate_integral;
+ int64_t writeback_rate_integral_scaled;
int64_t writeback_rate_change;
unsigned writeback_rate_update_seconds;
- unsigned writeback_rate_d_term;
+ unsigned writeback_rate_i_term_inverse;
unsigned writeback_rate_p_term_inverse;
+ unsigned writeback_rate_minimum;
};
enum alloc_reserve {
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 69f355b9650c..2290bffd4922 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -81,8 +81,9 @@ rw_attribute(writeback_delay);
rw_attribute(writeback_rate);
rw_attribute(writeback_rate_update_seconds);
-rw_attribute(writeback_rate_d_term);
+rw_attribute(writeback_rate_i_term_inverse);
rw_attribute(writeback_rate_p_term_inverse);
+rw_attribute(writeback_rate_minimum);
read_attribute(writeback_rate_debug);
read_attribute(stripe_size);
@@ -130,15 +131,16 @@ SHOW(__bch_cached_dev)
sysfs_hprint(writeback_rate, dc->writeback_rate.rate << 9);
var_print(writeback_rate_update_seconds);
- var_print(writeback_rate_d_term);
+ var_print(writeback_rate_i_term_inverse);
var_print(writeback_rate_p_term_inverse);
+ var_print(writeback_rate_minimum);
if (attr == &sysfs_writeback_rate_debug) {
char rate[20];
char dirty[20];
char target[20];
char proportional[20];
- char derivative[20];
+ char integral[20];
char change[20];
s64 next_io;
@@ -146,7 +148,7 @@ SHOW(__bch_cached_dev)
bch_hprint(dirty, bcache_dev_sectors_dirty(&dc->disk) << 9);
bch_hprint(target, dc->writeback_rate_target << 9);
bch_hprint(proportional,dc->writeback_rate_proportional << 9);
- bch_hprint(derivative, dc->writeback_rate_derivative << 9);
+ bch_hprint(integral, dc->writeback_rate_integral_scaled << 9);
bch_hprint(change, dc->writeback_rate_change << 9);
next_io = div64_s64(dc->writeback_rate.next - local_clock(),
@@ -157,11 +159,11 @@ SHOW(__bch_cached_dev)
"dirty:\t\t%s\n"
"target:\t\t%s\n"
"proportional:\t%s\n"
- "derivative:\t%s\n"
+ "integral:\t%s\n"
"change:\t\t%s/sec\n"
"next io:\t%llims\n",
rate, dirty, target, proportional,
- derivative, change, next_io);
+ integral, change, next_io);
}
sysfs_hprint(dirty_data,
@@ -213,7 +215,7 @@ STORE(__cached_dev)
dc->writeback_rate.rate, 1, INT_MAX);
d_strtoul_nonzero(writeback_rate_update_seconds);
- d_strtoul(writeback_rate_d_term);
+ d_strtoul(writeback_rate_i_term_inverse);
d_strtoul_nonzero(writeback_rate_p_term_inverse);
d_strtoi_h(sequential_cutoff);
@@ -319,7 +321,7 @@ static struct attribute *bch_cached_dev_files[] = {
&sysfs_writeback_percent,
&sysfs_writeback_rate,
&sysfs_writeback_rate_update_seconds,
- &sysfs_writeback_rate_d_term,
+ &sysfs_writeback_rate_i_term_inverse,
&sysfs_writeback_rate_p_term_inverse,
&sysfs_writeback_rate_debug,
&sysfs_dirty_data,
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 5e65a392287d..cac8678da5d0 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -25,48 +25,62 @@ static void __update_writeback_rate(struct cached_dev *dc)
bcache_flash_devs_sectors_dirty(c);
uint64_t cache_dirty_target =
div_u64(cache_sectors * dc->writeback_percent, 100);
-
int64_t target = div64_u64(cache_dirty_target * bdev_sectors(dc->bdev),
c->cached_dev_sectors);
- /* PD controller */
-
+ /*
+ * PI controller:
+ * Figures out the amount that should be written per second.
+ *
+ * First, the error (number of sectors that are dirty beyond our
+ * target) is calculated. The error is accumulated (numerically
+ * integrated).
+ *
+ * Then, the proportional value and integral value are scaled
+ * based on configured values. These are stored as inverses to
+ * avoid fixed point math and to make configuration easy-- e.g.
+ * the default value of 40 for writeback_rate_p_term_inverse
+ * attempts to write at a rate that would retire all the dirty
+ * blocks in 40 seconds.
+ *
+ * The writeback_rate_i_inverse value of 10000 means that 1/10000th
+ * of the error is accumulated in the integral term per second.
+ * This acts as a slow, long-term average that is not subject to
+ * variations in usage like the p term.
+ */
int64_t dirty = bcache_dev_sectors_dirty(&dc->disk);
- int64_t derivative = dirty - dc->disk.sectors_dirty_last;
- int64_t proportional = dirty - target;
- int64_t change;
-
- dc->disk.sectors_dirty_last = dirty;
-
- /* Scale to sectors per second */
-
- proportional *= dc->writeback_rate_update_seconds;
- proportional = div_s64(proportional, dc->writeback_rate_p_term_inverse);
-
- derivative = div_s64(derivative, dc->writeback_rate_update_seconds);
-
- derivative = ewma_add(dc->disk.sectors_dirty_derivative, derivative,
- (dc->writeback_rate_d_term /
- dc->writeback_rate_update_seconds) ?: 1, 0);
-
- derivative *= dc->writeback_rate_d_term;
- derivative = div_s64(derivative, dc->writeback_rate_p_term_inverse);
-
- change = proportional + derivative;
+ int64_t error = dirty - target;
+ int64_t proportional_scaled =
+ div_s64(error, dc->writeback_rate_p_term_inverse);
+ int64_t integral_scaled, new_rate;
+
+ if ((error < 0 && dc->writeback_rate_integral > 0) ||
+ (error > 0 && time_before64(local_clock(),
+ dc->writeback_rate.next + NSEC_PER_MSEC))) {
+ /*
+ * Only decrease the integral term if it's more than
+ * zero. Only increase the integral term if the device
+ * is keeping up. (Don't wind up the integral
+ * ineffectively in either case).
+ *
+ * It's necessary to scale this by
+ * writeback_rate_update_seconds to keep the integral
+ * term dimensioned properly.
+ */
+ dc->writeback_rate_integral += error *
+ dc->writeback_rate_update_seconds;
+ }
- /* Don't increase writeback rate if the device isn't keeping up */
- if (change > 0 &&
- time_after64(local_clock(),
- dc->writeback_rate.next + NSEC_PER_MSEC))
- change = 0;
+ integral_scaled = div_s64(dc->writeback_rate_integral,
+ dc->writeback_rate_i_term_inverse);
- dc->writeback_rate.rate =
- clamp_t(int64_t, (int64_t) dc->writeback_rate.rate + change,
- 1, NSEC_PER_MSEC);
+ new_rate = clamp_t(int64_t, (proportional_scaled + integral_scaled),
+ dc->writeback_rate_minimum, NSEC_PER_MSEC);
- dc->writeback_rate_proportional = proportional;
- dc->writeback_rate_derivative = derivative;
- dc->writeback_rate_change = change;
+ dc->writeback_rate_proportional = proportional_scaled;
+ dc->writeback_rate_integral_scaled = integral_scaled;
+ dc->writeback_rate_change = new_rate - dc->writeback_rate.rate;
+ dc->writeback_rate.rate = new_rate;
dc->writeback_rate_target = target;
}
@@ -499,8 +513,6 @@ void bch_sectors_dirty_init(struct bcache_device *d)
bch_btree_map_keys(&op.op, d->c, &KEY(op.inode, 0, 0),
sectors_dirty_init_fn, 0);
-
- d->sectors_dirty_last = bcache_dev_sectors_dirty(d);
}
void bch_cached_dev_writeback_init(struct cached_dev *dc)
@@ -514,10 +526,11 @@ void bch_cached_dev_writeback_init(struct cached_dev *dc)
dc->writeback_percent = 10;
dc->writeback_delay = 30;
dc->writeback_rate.rate = 1024;
+ dc->writeback_rate_minimum = 1;
dc->writeback_rate_update_seconds = 5;
- dc->writeback_rate_d_term = 30;
- dc->writeback_rate_p_term_inverse = 6000;
+ dc->writeback_rate_p_term_inverse = 40;
+ dc->writeback_rate_i_term_inverse = 10000;
INIT_DELAYED_WORK(&dc->writeback_rate_update, update_writeback_rate);
}
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 10/15] bcache: smooth writeback rate control
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (8 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 09/15] bcache: implement PI controller for writeback rate Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 11/15] bcache: writeback rate shouldn't artifically clamp Michael Lyle
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Michael Lyle
This works in conjunction with the new PI controller. Currently, in
real-world workloads, the rate controller attempts to write back 1
sector per second. In practice, these minimum-rate writebacks are
between 4k and 60k in test scenarios, since bcache aggregates and
attempts to do contiguous writes and because filesystems on top of
bcachefs typically write 4k or more.
Previously, bcache used to guarantee to write at least once per second.
This means that the actual writeback rate would exceed the configured
amount by a factor of 8-120 or more.
This patch adjusts to be willing to sleep up to 2.5 seconds, and to
target writing 4k/second. On the smallest writes, it will sleep 1
second like before, but many times it will sleep longer and load the
backing device less. This keeps the loading on the cache and backing
device related to writeback more consistent when writing back at low
rates.
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/util.c | 10 ++++++++--
drivers/md/bcache/writeback.c | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
index 176d3c2ef5f5..4dbe37e82877 100644
--- a/drivers/md/bcache/util.c
+++ b/drivers/md/bcache/util.c
@@ -232,8 +232,14 @@ uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done)
d->next += div_u64(done * NSEC_PER_SEC, d->rate);
- if (time_before64(now + NSEC_PER_SEC, d->next))
- d->next = now + NSEC_PER_SEC;
+ /* Bound the time. Don't let us fall further than 2 seconds behind
+ * (this prevents unnecessary backlog that would make it impossible
+ * to catch up). If we're ahead of the desired writeback rate,
+ * don't let us sleep more than 2.5 seconds (so we can notice/respond
+ * if the control system tells us to speed up!).
+ */
+ if (time_before64(now + NSEC_PER_SEC * 5 / 2, d->next))
+ d->next = now + NSEC_PER_SEC * 5 / 2;
if (time_after64(now - NSEC_PER_SEC * 2, d->next))
d->next = now - NSEC_PER_SEC * 2;
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index cac8678da5d0..8deb721c355e 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -526,7 +526,7 @@ void bch_cached_dev_writeback_init(struct cached_dev *dc)
dc->writeback_percent = 10;
dc->writeback_delay = 30;
dc->writeback_rate.rate = 1024;
- dc->writeback_rate_minimum = 1;
+ dc->writeback_rate_minimum = 8;
dc->writeback_rate_update_seconds = 5;
dc->writeback_rate_p_term_inverse = 40;
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 11/15] bcache: writeback rate shouldn't artifically clamp
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (9 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 10/15] bcache: smooth writeback rate control Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 12/15] bcache: rearrange writeback main thread ratelimit Michael Lyle
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Michael Lyle
The previous code artificially limited writeback rate to 1000000
blocks/second (NSEC_PER_MSEC), which is a rate that can be met on fast
hardware. The rate limiting code works fine (though with decreased
precision) up to 3 orders of magnitude faster, so use NSEC_PER_SEC.
Additionally, ensure that uint32_t is used as a type for rate throughout
the rate management so that type checking/clamp_t can work properly.
bch_next_delay should be rewritten for increased precision and better
handling of high rates and long sleep periods, but this is adequate for
now.
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reported-by: Coly Li <colyli@suse.de>
Reviewed-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/bcache.h | 2 +-
drivers/md/bcache/util.h | 4 ++--
drivers/md/bcache/writeback.c | 7 ++++---
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index eb83be693d60..d77c4829c497 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -361,7 +361,7 @@ struct cached_dev {
int64_t writeback_rate_proportional;
int64_t writeback_rate_integral;
int64_t writeback_rate_integral_scaled;
- int64_t writeback_rate_change;
+ int32_t writeback_rate_change;
unsigned writeback_rate_update_seconds;
unsigned writeback_rate_i_term_inverse;
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index cb8d2ccbb6c6..8f509290bb02 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -441,10 +441,10 @@ struct bch_ratelimit {
uint64_t next;
/*
- * Rate at which we want to do work, in units per nanosecond
+ * Rate at which we want to do work, in units per second
* The units here correspond to the units passed to bch_next_delay()
*/
- unsigned rate;
+ uint32_t rate;
};
static inline void bch_ratelimit_reset(struct bch_ratelimit *d)
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 8deb721c355e..897d28050656 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -52,7 +52,8 @@ static void __update_writeback_rate(struct cached_dev *dc)
int64_t error = dirty - target;
int64_t proportional_scaled =
div_s64(error, dc->writeback_rate_p_term_inverse);
- int64_t integral_scaled, new_rate;
+ int64_t integral_scaled;
+ uint32_t new_rate;
if ((error < 0 && dc->writeback_rate_integral > 0) ||
(error > 0 && time_before64(local_clock(),
@@ -74,8 +75,8 @@ static void __update_writeback_rate(struct cached_dev *dc)
integral_scaled = div_s64(dc->writeback_rate_integral,
dc->writeback_rate_i_term_inverse);
- new_rate = clamp_t(int64_t, (proportional_scaled + integral_scaled),
- dc->writeback_rate_minimum, NSEC_PER_MSEC);
+ new_rate = clamp_t(int32_t, (proportional_scaled + integral_scaled),
+ dc->writeback_rate_minimum, NSEC_PER_SEC);
dc->writeback_rate_proportional = proportional_scaled;
dc->writeback_rate_integral_scaled = integral_scaled;
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 12/15] bcache: rearrange writeback main thread ratelimit
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (10 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 11/15] bcache: writeback rate shouldn't artifically clamp Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 13/15] bcache: safeguard a dangerous addressing in closure_queue Michael Lyle
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Michael Lyle
The time spent searching for things to write back "counts" for the
actual rate achieved, so don't flush the accumulated rate with each
chunk.
This will maintain better fidelity to user-commanded rates, but it
may slightly increase the burstiness of writeback. The writeback
lock needs improvement to help mitigate this.
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Kent Overstreet <kent.overstreet@gmail.com>
---
drivers/md/bcache/writeback.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 897d28050656..9b770b13bdf6 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -440,6 +440,8 @@ static int bch_writeback_thread(void *arg)
struct cached_dev *dc = arg;
bool searched_full_index;
+ bch_ratelimit_reset(&dc->writeback_rate);
+
while (!kthread_should_stop()) {
down_write(&dc->writeback_lock);
if (!atomic_read(&dc->has_dirty) ||
@@ -467,7 +469,6 @@ static int bch_writeback_thread(void *arg)
up_write(&dc->writeback_lock);
- bch_ratelimit_reset(&dc->writeback_rate);
read_dirty(dc);
if (searched_full_index) {
@@ -477,6 +478,8 @@ static int bch_writeback_thread(void *arg)
!kthread_should_stop() &&
!test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags))
delay = schedule_timeout_interruptible(delay);
+
+ bch_ratelimit_reset(&dc->writeback_rate);
}
}
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 13/15] bcache: safeguard a dangerous addressing in closure_queue
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (11 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 12/15] bcache: rearrange writeback main thread ratelimit Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 14/15] bcache: Add Michael Lyle to MAINTAINERS Michael Lyle
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Liang Chen
From: Liang Chen <liangchen.linux@gmail.com>
The use of the union reduces the size of closure struct by taking advantage
of the current size of its members. The offset of func in work_struct
equals the size of the first three members, so that work.work_func will
just reference the forth member - fn.
This is smart but dangerous. It can be broken if work_struct or the other
structs get changed, and can be a bit difficult to debug.
Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
---
drivers/md/bcache/closure.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h
index 295b7e43f92c..00fb314cce57 100644
--- a/drivers/md/bcache/closure.h
+++ b/drivers/md/bcache/closure.h
@@ -251,6 +251,12 @@ static inline void set_closure_fn(struct closure *cl, closure_fn *fn,
static inline void closure_queue(struct closure *cl)
{
struct workqueue_struct *wq = cl->wq;
+ /**
+ * Changes made to closure, work_struct, or a couple of other structs
+ * may cause work.func not pointing to the right location.
+ */
+ BUILD_BUG_ON(offsetof(struct closure, fn)
+ != offsetof(struct work_struct, func));
if (wq) {
INIT_WORK(&cl->work, cl->work.func);
BUG_ON(!queue_work(wq, &cl->work));
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 14/15] bcache: Add Michael Lyle to MAINTAINERS
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (12 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 13/15] bcache: safeguard a dangerous addressing in closure_queue Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-13 23:35 ` [PATCH 15/15] bcache: MAINTAINERS: set bcache to MAINTAINED Michael Lyle
2017-10-16 15:08 ` [PATCH 00/15] bcache: series of patches for 4.15 Jens Axboe
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Kent Overstreet
From: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 02441c2e8c55..73213039bdb7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2564,6 +2564,7 @@ S: Maintained
F: drivers/net/hamradio/baycom*
BCACHE (BLOCK LAYER CACHE)
+M: Michael Lyle <mlyle@lyle.org>
M: Kent Overstreet <kent.overstreet@gmail.com>
L: linux-bcache@vger.kernel.org
W: http://bcache.evilpiepirate.org
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 15/15] bcache: MAINTAINERS: set bcache to MAINTAINED
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (13 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 14/15] bcache: Add Michael Lyle to MAINTAINERS Michael Lyle
@ 2017-10-13 23:35 ` Michael Lyle
2017-10-16 15:08 ` [PATCH 00/15] bcache: series of patches for 4.15 Jens Axboe
15 siblings, 0 replies; 17+ messages in thread
From: Michael Lyle @ 2017-10-13 23:35 UTC (permalink / raw)
To: linux-bcache, linux-block; +Cc: axboe, Michael Lyle
Also add URL for IRC channel.
Signed-off-by: Michael Lyle <mlyle@lyle.org>
---
MAINTAINERS | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 73213039bdb7..b3203e082a1e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2568,7 +2568,8 @@ M: Michael Lyle <mlyle@lyle.org>
M: Kent Overstreet <kent.overstreet@gmail.com>
L: linux-bcache@vger.kernel.org
W: http://bcache.evilpiepirate.org
-S: Orphan
+C: irc://irc.oftc.net/bcache
+S: Maintained
F: drivers/md/bcache/
BDISP ST MEDIA DRIVER
--
2.11.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 00/15] bcache: series of patches for 4.15
2017-10-13 23:35 [PATCH 00/15] bcache: series of patches for 4.15 Michael Lyle
` (14 preceding siblings ...)
2017-10-13 23:35 ` [PATCH 15/15] bcache: MAINTAINERS: set bcache to MAINTAINED Michael Lyle
@ 2017-10-16 15:08 ` Jens Axboe
15 siblings, 0 replies; 17+ messages in thread
From: Jens Axboe @ 2017-10-16 15:08 UTC (permalink / raw)
To: Michael Lyle; +Cc: linux-bcache, linux-block
On Fri, Oct 13 2017, Michael Lyle wrote:
> Jens, and everyone:
>
> Here is the current series of work for inclusion in next and for 4.15's
> merge window. We may get some additional fixes, but this is most of the
> work we expect. All have been previously sent to these lists except the
> very last one.
>
> There's a lot of small cleanup patches and fixes for race conditions.
>
> Also included is my new rate controller which we've been measuring for
> some time, and other related changes to writeback rate management.
Applied for 4.15, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 17+ messages in thread