aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2018-08-02 22:28:27 +0800
committerColy Li <colyli@suse.de>2018-08-02 22:28:27 +0800
commit356a3c6117f9440f423a76f7df406812f328dfbf (patch)
tree8bf064168657d2ce0aa504b88050579169da990f
parent3dff17dc50789d1e8616de4a96804915f67c2f79 (diff)
downloadbcache-patches-356a3c6117f9440f423a76f7df406812f328dfbf.tar.gz
for-next: update patches for 4.19 second wave
-rw-r--r--for-next/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch (renamed from for-review/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch)13
-rw-r--r--for-next/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch (renamed from for-review/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch)4
-rw-r--r--for-next/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch (renamed from for-review/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch)6
-rw-r--r--for-next/0004-bcache-add-a-comment-in-super.c.patch (renamed from for-review/0004-bcache-add-a-comment-in-register_bdev.patch)10
-rw-r--r--for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch33
-rw-r--r--for-next/0006-bcache-fix-mistaken-comments-in-request.c.patch (renamed from for-review/0006-bcache-fix-mistaken-comments-in-bch_keylist_realloc.patch)12
-rw-r--r--for-next/0007-bcache-add-code-comments-for-bset.c.patch (renamed from for-review/0007-bcache-add-code-comments-for-bset.c.patch)4
-rw-r--r--for-next/0008-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch (renamed from for-review/0009-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch)31
-rw-r--r--for-next/0009-bcache-recal-cached_dev_sectors-on-detach.patch30
-rw-r--r--for-review/0005-bcache-fix-mistaken-code-comments-in-struct-cache.patch27
10 files changed, 110 insertions, 60 deletions
diff --git a/for-review/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch b/for-next/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch
index 42c6a93..54782b1 100644
--- a/for-review/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch
+++ b/for-next/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch
@@ -1,4 +1,4 @@
-From 94b89de4a8d943744d918729ad4e230bc20fc1f7 Mon Sep 17 00:00:00 2001
+From 3678e3fc53da440570bb61fface0d6af11f96cae Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Tue, 22 May 2018 14:29:09 +0800
Subject: [PATCH 1/9] bcache: do not check return value of debugfs_create_dir()
@@ -16,6 +16,7 @@ This patch does not fix exact bug, just makes things work as they should.
Signed-off-by: Coly Li <colyli@suse.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: stable@vger.kernel.org
Cc: Kai Krakow <kai@kaishome.de>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
---
@@ -27,7 +28,7 @@ Cc: Kent Overstreet <kent.overstreet@gmail.com>
5 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index 872ef4d67711..a44bd427e5ba 100644
+index 872ef4d67711..0a3e82b0876d 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -1001,7 +1001,7 @@ void bch_open_buckets_free(struct cache_set *);
@@ -35,7 +36,7 @@ index 872ef4d67711..a44bd427e5ba 100644
void bch_debug_exit(void);
-int bch_debug_init(struct kobject *);
-+void bch_debug_init(struct kobject *);
++void bch_debug_init(struct kobject *kobj);
void bch_request_exit(void);
int bch_request_init(void);
@@ -85,10 +86,10 @@ index 71427eb5fdae..7c2c5bc7c88b 100644
static inline void closure_debug_destroy(struct closure *cl) {}
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
-index d030ce3025a6..57f8f5aeee55 100644
+index 04d146711950..12034c07257b 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
-@@ -248,11 +248,12 @@ void bch_debug_exit(void)
+@@ -252,11 +252,12 @@ void bch_debug_exit(void)
debugfs_remove_recursive(bcache_debug);
}
@@ -125,5 +126,5 @@ index e0a92104ca23..c7ffa6ef3f82 100644
err:
bcache_exit();
--
-2.17.1
+2.18.0
diff --git a/for-review/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch b/for-next/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch
index df32ad6..6531207 100644
--- a/for-review/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch
+++ b/for-next/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch
@@ -1,4 +1,4 @@
-From bde44fb227c1b77a6010e6348af40a10d0e5f095 Mon Sep 17 00:00:00 2001
+From 7ee659583a709e9a0da10a9a5d3e9bc103d94853 Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Sat, 5 May 2018 20:52:33 +0800
Subject: [PATCH 2/9] bcache: display rate debug parameters to 0 when writeback
@@ -67,5 +67,5 @@ index 225b15aa0340..3e9d3459a224 100644
return sprintf(buf,
"rate:\t\t%s/sec\n"
--
-2.17.1
+2.18.0
diff --git a/for-review/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch b/for-next/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch
index 5709dca..4063f8d 100644
--- a/for-review/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch
+++ b/for-next/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch
@@ -1,4 +1,4 @@
-From 0a1178a25e406e22da6103bef5b04b701f6036a3 Mon Sep 17 00:00:00 2001
+From 3fc57055129d0f3f0002643ca28bcc242c974b02 Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Mon, 26 Mar 2018 15:05:08 +0800
Subject: [PATCH 3/9] bcache: avoid unncessary cache prefetch
@@ -8,7 +8,7 @@ In bch_btree_node_get() the read-in btree node will be partially
prefetched into L1 cache for following bset iteration (if there is).
But if the btree node read is failed, the perfetch operations will
waste L1 cache space. This patch checkes whether read operation and
-only does cache prefetch when read I/O successed.
+only does cache prefetch when read I/O succeeded.
Signed-off-by: Coly Li <colyli@suse.de>
---
@@ -48,5 +48,5 @@ index 475008fbbaab..c19f7716df88 100644
}
--
-2.17.1
+2.18.0
diff --git a/for-review/0004-bcache-add-a-comment-in-register_bdev.patch b/for-next/0004-bcache-add-a-comment-in-super.c.patch
index ec44e02..32b5b1c 100644
--- a/for-review/0004-bcache-add-a-comment-in-register_bdev.patch
+++ b/for-next/0004-bcache-add-a-comment-in-super.c.patch
@@ -1,8 +1,12 @@
-From 886a65290375fbd4e7658754b1fcfd207190aa33 Mon Sep 17 00:00:00 2001
+From ec367ac0b48e43f6e8707ab10864f8ffd5220f5e Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Mon, 20 Nov 2017 16:53:48 +0800
-Subject: [PATCH 4/9] bcache: add a comment in register_bdev()
+Subject: [PATCH 4/9] bcache: add a comment in super.c
+This patch adds a line of code comment in super.c:register_bdev(), to
+make code to be more comprehensible.
+
+Signed-off-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/super.c | 1 +
1 file changed, 1 insertion(+)
@@ -20,5 +24,5 @@ index c7ffa6ef3f82..f517d7d1fa10 100644
bch_cached_dev_attach(dc, c, NULL);
--
-2.17.1
+2.18.0
diff --git a/for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch b/for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch
new file mode 100644
index 0000000..8ec2c5d
--- /dev/null
+++ b/for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch
@@ -0,0 +1,33 @@
+From c171ac9c60af11ec055e246d3ad50900381b905c Mon Sep 17 00:00:00 2001
+From: Coly Li <colyli@suse.de>
+Date: Mon, 13 Nov 2017 23:55:01 +0800
+Subject: [PATCH 5/9] bcache: fix mistaken code comments in bcache.h
+
+This patch updates the code comment in struct cache with correct array
+names, to make the code to be more comprehensible.
+
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ drivers/md/bcache/bcache.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
+index 0a3e82b0876d..b393b3fd06b6 100644
+--- a/drivers/md/bcache/bcache.h
++++ b/drivers/md/bcache/bcache.h
+@@ -423,9 +423,9 @@ struct cache {
+ /*
+ * When allocating new buckets, prio_write() gets first dibs - since we
+ * may not be allocate at all without writing priorities and gens.
+- * prio_buckets[] contains the last buckets we wrote priorities to (so
+- * gc can mark them as metadata), prio_next[] contains the buckets
+- * allocated for the next prio write.
++ * prio_last_buckets[] contains the last buckets we wrote priorities to
++ * (so gc can mark them as metadata), prio_buckets[] contains the
++ * buckets allocated for the next prio write.
+ */
+ uint64_t *prio_buckets;
+ uint64_t *prio_last_buckets;
+--
+2.18.0
+
diff --git a/for-review/0006-bcache-fix-mistaken-comments-in-bch_keylist_realloc.patch b/for-next/0006-bcache-fix-mistaken-comments-in-request.c.patch
index db9b499..aee1030 100644
--- a/for-review/0006-bcache-fix-mistaken-comments-in-bch_keylist_realloc.patch
+++ b/for-next/0006-bcache-fix-mistaken-comments-in-request.c.patch
@@ -1,14 +1,18 @@
-From f52cde84be9dce230b5313b0eab6601d27475f12 Mon Sep 17 00:00:00 2001
+From 00c62fb5182203fd9911736115ca9ddbcaf680a6 Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Tue, 14 Nov 2017 00:09:50 +0800
-Subject: [PATCH 6/9] bcache: fix mistaken comments in bch_keylist_realloc()
+Subject: [PATCH 6/9] bcache: fix mistaken comments in request.c
+This patch updates code comment in bch_keylist_realloc() by fixing
+incorrected function names, to make the code to be more comprehennsible.
+
+Signed-off-by: Coly Li <colyli@suse.de>
---
drivers/md/bcache/request.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
-index 8eece9ef9f46..91206f329971 100644
+index 43af905920f5..914d501ad1e0 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -107,7 +107,7 @@ static int bch_keylist_realloc(struct keylist *l, unsigned u64s,
@@ -21,5 +25,5 @@ index 8eece9ef9f46..91206f329971 100644
*/
if (newsize * sizeof(uint64_t) > block_bytes(c) - sizeof(struct jset))
--
-2.17.1
+2.18.0
diff --git a/for-review/0007-bcache-add-code-comments-for-bset.c.patch b/for-next/0007-bcache-add-code-comments-for-bset.c.patch
index 3fa64bd..b7ba3eb 100644
--- a/for-review/0007-bcache-add-code-comments-for-bset.c.patch
+++ b/for-next/0007-bcache-add-code-comments-for-bset.c.patch
@@ -1,4 +1,4 @@
-From 64e21e8d59835f750023918be1c0d3d3162cb983 Mon Sep 17 00:00:00 2001
+From 9879a0caf2a5c9d2143b9d386092012f50eae963 Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Thu, 12 Apr 2018 17:24:18 +0800
Subject: [PATCH 7/9] bcache: add code comments for bset.c
@@ -145,5 +145,5 @@ index f3403b45bc28..596c93b44e9b 100644
* ? j * 2
* : j * 2 + 1;
--
-2.17.1
+2.18.0
diff --git a/for-review/0009-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch b/for-next/0008-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch
index 2fac7aa..908fcda 100644
--- a/for-review/0009-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch
+++ b/for-next/0008-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch
@@ -1,7 +1,7 @@
-From 1bcaca9df4b3bedd43863a0e9ec56990418b5ce3 Mon Sep 17 00:00:00 2001
+From 9c26e5fd96446919cc77c14a09ba9b6cf2320ab5 Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Thu, 26 Jul 2018 15:16:11 +0800
-Subject: [PATCH 9/9] bcache: set max writeback rate when I/O request is idle
+Subject: [PATCH 8/9] bcache: set max writeback rate when I/O request is idle
Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle")
allows the writeback rate to be faster if there is no I/O request on a
@@ -36,16 +36,16 @@ Tested-by: Stefan Priebe <s.priebe@profihost.ag>
Cc: Michael Lyle <mlyle@lyle.org>
---
drivers/md/bcache/bcache.h | 10 ++--
- drivers/md/bcache/request.c | 54 ++++++++++++++++++++-
+ drivers/md/bcache/request.c | 59 ++++++++++++++++++++++-
drivers/md/bcache/super.c | 4 ++
drivers/md/bcache/sysfs.c | 15 ++++--
drivers/md/bcache/util.c | 2 +-
drivers/md/bcache/util.h | 2 +-
drivers/md/bcache/writeback.c | 91 +++++++++++++++++++++++------------
- 7 files changed, 134 insertions(+), 44 deletions(-)
+ 7 files changed, 138 insertions(+), 45 deletions(-)
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index 5f7082aab1b0..97489573dedc 100644
+index b393b3fd06b6..05f82ff6f016 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -328,13 +328,6 @@ struct cached_dev {
@@ -80,10 +80,10 @@ index 5f7082aab1b0..97489573dedc 100644
uint64_t cached_dev_sectors;
atomic_long_t flash_dev_dirty_sectors;
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
-index 91206f329971..86a977c2a176 100644
+index 914d501ad1e0..7dbe8b6316a0 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
-@@ -1105,6 +1105,44 @@ static void detached_dev_do_request(struct bcache_device *d, struct bio *bio)
+@@ -1103,6 +1103,44 @@ static void detached_dev_do_request(struct bcache_device *d, struct bio *bio)
generic_make_request(bio);
}
@@ -128,11 +128,12 @@ index 91206f329971..86a977c2a176 100644
/* Cached devices - read & write stuff */
static blk_qc_t cached_dev_make_request(struct request_queue *q,
-@@ -1122,7 +1160,21 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q,
+@@ -1120,8 +1158,25 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q,
return BLK_QC_T_NONE;
}
- atomic_set(&dc->backing_idle, 0);
+- generic_start_io_acct(q, bio_op(bio), bio_sectors(bio), &d->disk->part0);
+ if (likely(d->c)) {
+ if (atomic_read(&d->c->idle_counter))
+ atomic_set(&d->c->idle_counter, 0);
@@ -148,9 +149,13 @@ index 91206f329971..86a977c2a176 100644
+ }
+ }
+
- generic_start_io_acct(q, rw, bio_sectors(bio), &d->disk->part0);
++ generic_start_io_acct(q,
++ bio_op(bio),
++ bio_sectors(bio),
++ &d->disk->part0);
bio_set_dev(bio, dc->bdev);
+ bio->bi_iter.bi_sector += dc->sb.data_offset;
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index f517d7d1fa10..32b95f3b9461 100644
--- a/drivers/md/bcache/super.c
@@ -221,7 +226,7 @@ index 3e9d3459a224..6e88142514fb 100644
sysfs_strtoul_clamp(writeback_rate_update_seconds,
dc->writeback_rate_update_seconds,
diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
-index f912c372978c..c6a99dfa1ad9 100644
+index fc479b026d6d..b15256bcf0e7 100644
--- a/drivers/md/bcache/util.c
+++ b/drivers/md/bcache/util.c
@@ -200,7 +200,7 @@ uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done)
@@ -234,10 +239,10 @@ index f912c372978c..c6a99dfa1ad9 100644
/* Bound the time. Don't let us fall further than 2 seconds behind
* (this prevents unnecessary backlog that would make it impossible
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
-index a1579e28049f..5ff055f0a653 100644
+index cced87f8eb27..f7b0133c9d2f 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
-@@ -443,7 +443,7 @@ struct bch_ratelimit {
+@@ -442,7 +442,7 @@ struct bch_ratelimit {
* Rate at which we want to do work, in units per second
* The units here correspond to the units passed to bch_next_delay()
*/
@@ -374,5 +379,5 @@ index 912e969fedba..481d4cf38ac0 100644
dc->writeback_rate_update_seconds = WRITEBACK_RATE_UPDATE_SECS_DEFAULT;
--
-2.17.1
+2.18.0
diff --git a/for-next/0009-bcache-recal-cached_dev_sectors-on-detach.patch b/for-next/0009-bcache-recal-cached_dev_sectors-on-detach.patch
new file mode 100644
index 0000000..e23ebb9
--- /dev/null
+++ b/for-next/0009-bcache-recal-cached_dev_sectors-on-detach.patch
@@ -0,0 +1,30 @@
+From 23ff3d829b6be6ff1c404558a4c8945b45e69394 Mon Sep 17 00:00:00 2001
+From: Shenghui Wang <shhuiw@foxmail.com>
+Date: Tue, 31 Jul 2018 19:24:09 +0800
+Subject: [PATCH 9/9] bcache: recal cached_dev_sectors on detach
+
+Recal cached_dev_sectors on cached_dev detached, as recal done on
+cached_dev attached.
+
+Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ drivers/md/bcache/super.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
+index 32b95f3b9461..db2e7d12c4b6 100644
+--- a/drivers/md/bcache/super.c
++++ b/drivers/md/bcache/super.c
+@@ -999,6 +999,7 @@ static void cached_dev_detach_finish(struct work_struct *w)
+
+ bcache_device_detach(&dc->disk);
+ list_move(&dc->list, &uncached_devices);
++ calc_cached_dev_sectors(dc->disk->c);
+
+ clear_bit(BCACHE_DEV_DETACHING, &dc->disk.flags);
+ clear_bit(BCACHE_DEV_UNLINK_DONE, &dc->disk.flags);
+--
+2.18.0
+
diff --git a/for-review/0005-bcache-fix-mistaken-code-comments-in-struct-cache.patch b/for-review/0005-bcache-fix-mistaken-code-comments-in-struct-cache.patch
deleted file mode 100644
index a08e892..0000000
--- a/for-review/0005-bcache-fix-mistaken-code-comments-in-struct-cache.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From e05af076f732a234375a9c293cd5face31248785 Mon Sep 17 00:00:00 2001
-From: Coly Li <colyli@suse.de>
-Date: Mon, 13 Nov 2017 23:55:01 +0800
-Subject: [PATCH 5/9] bcache: fix mistaken code comments in struct cache
-
----
- drivers/md/bcache/bcache.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index a44bd427e5ba..5f7082aab1b0 100644
---- a/drivers/md/bcache/bcache.h
-+++ b/drivers/md/bcache/bcache.h
-@@ -423,8 +423,8 @@ struct cache {
- /*
- * When allocating new buckets, prio_write() gets first dibs - since we
- * may not be allocate at all without writing priorities and gens.
-- * prio_buckets[] contains the last buckets we wrote priorities to (so
-- * gc can mark them as metadata), prio_next[] contains the buckets
-+ * prio_last_buckets[] contains the last buckets we wrote priorities to (so
-+ * gc can mark them as metadata), prio_buckets[] contains the buckets
- * allocated for the next prio write.
- */
- uint64_t *prio_buckets;
---
-2.17.1
-