[PATCH v2 07/12] bcache: add CACHE_SET_IO_DISABLE to struct cache_set flags

2018-01-13 Thread Coly Li
Changelog v2, - use cache_set->flags to set io disable bit, suggested by Junhui. - check CACHE_SET_IO_DISABLE in bch_btree_gc() to stop a while-loop, this is reported and inspired from origal patch of Pavel Vazharov. v1, initial version. Signed-off-by: Coly Li <col...@suse.de> Reviewed-b

[PATCH v2 06/12] bcache: set error_limit correctly

2018-01-13 Thread Coly Li
ense, it is enough for most of cache devices. Changelog: v2: add reviewed-by from Hannes. v1: initial version for review. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Michael Lyle <ml...@lyle.org> Cc: Junhui Tang <tang.jun...@zte.com.

[PATCH v2 05/12] bcache: stop dc->writeback_rate_update properly

2018-01-13 Thread Coly Li
s (e.g. hold dc->count, or use locks), this is the only way I can find which works to properly stop dc->writeback_rate_update delayed work. Changelog: v2: Try to fix the race issue which is pointed out by Junhui. v1: The initial version for review Signed-off-by: Coly Li <col...@suse.de> Cc

[PATCH v2 03/12] bcache: set task properly in allocator_wait()

2018-01-13 Thread Coly Li
ngelog: v2: fix the race issue in v1 patch. v1: initial buggy fix. Signed-off-by: Coly Li <col...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke <h...@suse.de> Cc: Junhui Tang <tang.jun...@zte.com.cn> --- drivers/md/bcache/alloc.c | 4 +++- 1 file changed, 3

[PATCH v2 04/12] bcache: fix cached_dev->count usage for bch_cache_set_error()

2018-01-13 Thread Coly Li
or system reboot, cached_dev->count can always be used correctly. The patch is simple, but understanding how it works is quite complicated. Changelog: v2: set dc->writeback_thread to NULL in this patch, as suggested by Hannes. v1: inital version for review. Signed-off-by: Coly Li <

[PATCH v2 09/12] bcache: fix inaccurate io state for detached bcache devices

2018-01-13 Thread Coly Li
d_dev_get(dc)) { //will callback generic_end_io_acct() } else { //will not call generic_end_io_acct() } This patch calls generic_end_io_acct() in the end of IO for detached devices, so we can show IO state correctly. (Modified to use GFP_NOIO in kzalloc() by Coly Li) Signed-off-by: Tang Junh

[PATCH v2 08/12] bcache: stop all attached bcache devices for a retired cache set

2018-01-13 Thread Coly Li
connected. Changelog: v2: add reviewed-by from Hannes. v1: initial version for review. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- drivers/md/bcache/super.

[PATCH v2 02/12] bcache: properly set task state in bch_writeback_thread()

2018-01-13 Thread Coly Li
is warning message scares users, makes them feel there might be something risky with bcache and hurt their data. Setting task state to TASK_RUNNING before returning fixes this problem. Changelog: v2: fix the race issue in v1 patch. v1: initial buggy fix. Signed-off-by: Coly Li <col...@s

[PATCH v2 04/12] bcache: fix cached_dev->count usage for bch_cache_set_error()

2018-01-13 Thread Coly Li
or system reboot, cached_dev->count can always be used correctly. The patch is simple, but understanding how it works is quite complicated. Changelog: v2: set dc->writeback_thread to NULL in this patch, as suggested by Hannes. v1: inital version for review. Signed-off-by: Coly Li <

[PATCH v2 03/12] bcache: set task properly in allocator_wait()

2018-01-13 Thread Coly Li
ngelog: v2: fix the race issue in v1 patch. v1: initial buggy fix. Signed-off-by: Coly Li <col...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke <h...@suse.de> Cc: Junhui Tang <tang.jun...@zte.com.cn> --- drivers/md/bcache/alloc.c | 4 +++- 1 file changed, 3

[PATCH v2 00/12] bcache: device failure handling improvement

2018-01-13 Thread Coly Li
es all problems found in v1 review. add patches to handle backing device failure. add one more patch to set writeback_rate_update_seconds range. include a patch from Junhui Tang. v1: the initial version, only handles cache device failure. Coly Li (11): bcache: set writeback_rate_update_s

[PATCH v2 01/12] bcache: set writeback_rate_update_seconds in range [1, 60] seconds

2018-01-13 Thread Coly Li
to decide a reasonable small timeout. This patch limits sysfs interface to set dc->writeback_rate_update_seconds in range of [1, 60] seconds, and replaces the hand-coded number by macros. Signed-off-by: Coly Li <col...@suse.de> --- drivers/md/bcache/sysfs.c | 3 +++ drivers/md/bcac

[PATCH v2 02/12] bcache: properly set task state in bch_writeback_thread()

2018-01-13 Thread Coly Li
is warning message scares users, makes them feel there might be something risky with bcache and hurt their data. Setting task state to TASK_RUNNING before returning fixes this problem. Changelog: v2: fix the race issue in v1 patch. v1: initial buggy fix. Signed-off-by: Coly Li <col...@s

[PATCH v2 00/12] bcache: device failure handling improvement

2018-01-13 Thread Coly Li
es all problems found in v1 review. add patches to handle backing device failure. add one more patch to set writeback_rate_update_seconds range. include a patch from Junhui Tang. v1: the initial version, only handles cache device failure. Coly Li (11): bcache: set writeback_rate_update_s

[PATCH v2 01/12] bcache: set writeback_rate_update_seconds in range [1, 60] seconds

2018-01-13 Thread Coly Li
to decide a reasonable small timeout. This patch limits sysfs interface to set dc->writeback_rate_update_seconds in range of [1, 60] seconds, and replaces the hand-coded number by macros. Signed-off-by: Coly Li <col...@suse.de> --- drivers/md/bcache/sysfs.c | 3 +++ drivers/md/bcac

[PATCH v2 06/12] bcache: set error_limit correctly

2018-01-13 Thread Coly Li
ense, it is enough for most of cache devices. Changelog: v2: add reviewed-by from Hannes. v1: initial version for review. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Michael Lyle <ml...@lyle.org> Cc: Junhui Tang <tang.jun...@zte.com.

[PATCH v2 05/12] bcache: stop dc->writeback_rate_update properly

2018-01-13 Thread Coly Li
s (e.g. hold dc->count, or use locks), this is the only way I can find which works to properly stop dc->writeback_rate_update delayed work. Changelog: v2: Try to fix the race issue which is pointed out by Junhui. v1: The initial version for review Signed-off-by: Coly Li <col...@suse.de> Cc

[PATCH v2 12/12] bcache: stop bcache device when backing device is offline

2018-01-13 Thread Coly Li
sers need to recovery the backing device, register and attach it manually. Changelog: v2: this is new added in v2 patch set. Signed-off-by: Coly Li <col...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> ---

[PATCH v2 12/12] bcache: stop bcache device when backing device is offline

2018-01-13 Thread Coly Li
sers need to recovery the backing device, register and attach it manually. Changelog: v2: this is new added in v2 patch set. Signed-off-by: Coly Li <col...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> ---

[PATCH v2 10/12] bcache: add backing_request_endio() for bi_end_io of attached backing device I/O

2018-01-13 Thread Coly Li
set. Signed-off-by: Coly Li <col...@suse.de> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- drivers/md/bcache/request.c | 95 +++ drivers/md/bcache/super.c | 1 + drivers/md/bcache/writeback.c | 1 + 3

[PATCH v4 10/13] bcache: add backing_request_endio() for bi_end_io of attached backing device I/O

2018-01-27 Thread Coly Li
set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- drivers/md/bcache/request.c | 95 +++ drivers/md/bcache/super.

[PATCH v4 04/13] bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set

2018-01-27 Thread Coly Li
t patch "bcache: fix cached_dev->count usage for bch_cache_set_error()" already gets a "Reviewed-by:" from Hannes Reinecke. Also this fix is not trivial and good for a separate patch. Signed-off-by: Coly Li <col...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke

[PATCH v4 13/13] bcache: add stop_when_cache_set_failed to struct cached_dev

2018-01-28 Thread Coly Li
broken or disconnected cache set is retiring. When the cached device has dirty data on retiring cache set, if bcache device is not stopped, following I/O request on the bcache device may result data corruption on backing device. This patch also prints out warn- ing information in kernel message. Signed-off-by

[PATCH v4 02/13] bcache: properly set task state in bch_writeback_thread()

2018-01-27 Thread Coly Li
: merge two similar fixes into one patch v2: fix the race issue in v1 patch. v1: initial buggy fix. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Junhui Tang <tang.jun...@zte.com.cn> --- drivers/

[PATCH v4 09/13] bcache: fix inaccurate io state for detached bcache devices

2018-01-27 Thread Coly Li
d_dev_get(dc)) { //will callback generic_end_io_acct() } else { //will not call generic_end_io_acct() } This patch calls generic_end_io_acct() in the end of IO for detached devices, so we can show IO state correctly. (Modified to use GFP_NOIO in kzalloc() by Coly Li) Signed-off-by: Tang Junh

[PATCH v4 05/13] bcache: stop dc->writeback_rate_update properly

2018-01-27 Thread Coly Li
s (e.g. hold dc->count, or use locks), this is the only way I can find which works to properly stop dc->writeback_rate_update delayed work. Changelog: v2: Try to fix the race issue which is pointed out by Junhui. v1: The initial version for review Signed-off-by: Coly Li <col...@suse.de> Cc

[PATCH v4 12/13] bcache: stop bcache device when backing device is offline

2018-01-27 Thread Coly Li
sers need to recovery the backing device, register and attach it manually. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Michael Lyle <ml...@lyle.org> Cc: Junhui Tang <tang.jun...@zte.com.cn> --- drivers/md/bcache/bcache.h | 2 ++

[PATCH v4 01/13] bcache: set writeback_rate_update_seconds in range [1, 60] seconds

2018-01-27 Thread Coly Li
to decide a reasonable small timeout. This patch limits sysfs interface to set dc->writeback_rate_update_seconds in range of [1, 60] seconds, and replaces the hand-coded number by macros. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- d

[PATCH v4 00/13] bcache: device failure handling improvement

2018-01-27 Thread Coly Li
fix detach issue find in v2 patch set. v2: fixes all problems found in v1 review. add patches to handle backing device failure. add one more patch to set writeback_rate_update_seconds range. include a patch from Junhui Tang. v1: the initial version, only handles cache device failure. Col

[PATCH v4 03/13] bcache: fix cached_dev->count usage for bch_cache_set_error()

2018-01-27 Thread Coly Li
or system reboot, cached_dev->count can always be used correctly. The patch is simple, but understanding how it works is quite complicated. Changelog: v2: set dc->writeback_thread to NULL in this patch, as suggested by Hannes. v1: initial version for review. Signed-off-by: Coly Li <

[PATCH v4 13/13] bcache: add stop_when_cache_set_failed to struct cached_dev

2018-01-27 Thread Coly Li
broken or disconnected cache set is retiring. When the cached device has dirty data on retiring cache set, if bcache device is not stopped, following I/O request on the bcache device may result data corruption on backing device. This patch also prints out warn- ing information in kernel message. Signed-off-by

Re: [PATCH] bcache: finish incremental GC

2018-01-29 Thread Coly Li
unhui, It sounds great :-) Currently I am not very familiar with gc code, I need some time to understand how bcache GC works before providing my feedback. Please give me some time, I hope I am able to provide my comment after Chinese Spring Festival. Hope other people may have a look before I am able to. Thanks. Coly Li [code snip]

Re: [PATCH v4 05/13] bcache: stop dc->writeback_rate_update properly

2018-01-29 Thread Coly Li
e called. And in update_writeback_rate() the bit BCACHE_DEV_RATE_DW_RUNNING is cleared after schedule_delayed_work() returns, so the race is killed. A mutex lock indicates an implicit memory barrier, and in your suggestion up_read(>writeback_lock) is after schedule_delayed_work() too. This is why I sa

Re: [PATCH v4 13/13] bcache: add stop_when_cache_set_failed to struct cached_dev

2018-01-29 Thread Coly Li
On 29/01/2018 8:57 PM, Nix wrote: > On 27 Jan 2018, Coly Li said: > >> Current bcache failure handling code will stop all attached bcache devices >> when the cache set is broken or disconnected. This is desired behavior for >> most of enterprise or cloud use cases, b

[PATCH v4 04/13] bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set

2018-01-27 Thread Coly Li
t patch "bcache: fix cached_dev->count usage for bch_cache_set_error()" already gets a "Reviewed-by:" from Hannes Reinecke. Also this fix is not trivial and good for a separate patch. Signed-off-by: Coly Li <col...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke

[PATCH v4 06/13] bcache: set error_limit correctly

2018-01-27 Thread Coly Li
ense, it is enough for most of cache devices. Changelog: v2: add reviewed-by from Hannes. v1: initial version for review. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Tang Junhui <tang.jun...@zte.com.cn> Cc: Junhui Tang &l

[PATCH v4 02/13] bcache: properly set task state in bch_writeback_thread()

2018-01-27 Thread Coly Li
: merge two similar fixes into one patch v2: fix the race issue in v1 patch. v1: initial buggy fix. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.de> Cc: Michael Lyle <ml...@lyle.org> Cc: Junhui Tang <tang.jun...@zte.com.cn> --- drivers/

[PATCH v4 01/13] bcache: set writeback_rate_update_seconds in range [1, 60] seconds

2018-01-27 Thread Coly Li
to decide a reasonable small timeout. This patch limits sysfs interface to set dc->writeback_rate_update_seconds in range of [1, 60] seconds, and replaces the hand-coded number by macros. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- d

[PATCH v4 08/13] bcache: stop all attached bcache devices for a retired cache set

2018-01-27 Thread Coly Li
connected. Changelog: v2: add reviewed-by from Hannes. v1: initial version for review. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- drivers/md/bcache/super.

[PATCH v4 11/13] bcache: add io_disable to struct cached_dev

2018-01-27 Thread Coly Li
ing device is broken of disconnected, and I/O errors reach its error limit, backing device will be disabled and the associated bcache device will be removed from system. Changelog: v2: indeed this is new added in v2 patch set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Re

Re: [PATCH v4 13/13] bcache: add stop_when_cache_set_failed to struct cached_dev

2018-01-27 Thread Coly Li
exists but slower, for large scale deployed environment, it is confused and misleading. After thinking for a while, I feel the "auto"/"always" options can make both enterprise and home users get an agreement. I am not able to find other better solution so far, thank you for th

[PATCH v4 08/13] bcache: stop all attached bcache devices for a retired cache set

2018-01-27 Thread Coly Li
connected. Changelog: v2: add reviewed-by from Hannes. v1: initial version for review. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- drivers/md/bcache/super.

[PATCH v4 10/13] bcache: add backing_request_endio() for bi_end_io of attached backing device I/O

2018-01-27 Thread Coly Li
set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- drivers/md/bcache/request.c | 95 +++ drivers/md/bcache/super.

[PATCH v4 09/13] bcache: fix inaccurate io state for detached bcache devices

2018-01-27 Thread Coly Li
d_dev_get(dc)) { //will callback generic_end_io_acct() } else { //will not call generic_end_io_acct() } This patch calls generic_end_io_acct() in the end of IO for detached devices, so we can show IO state correctly. (Modified to use GFP_NOIO in kzalloc() by Coly Li) Signed-off-by: Tang Junh

[PATCH v4 03/13] bcache: fix cached_dev->count usage for bch_cache_set_error()

2018-01-27 Thread Coly Li
or system reboot, cached_dev->count can always be used correctly. The patch is simple, but understanding how it works is quite complicated. Changelog: v2: set dc->writeback_thread to NULL in this patch, as suggested by Hannes. v1: initial version for review. Signed-off-by: Coly Li <

[PATCH v4 05/13] bcache: stop dc->writeback_rate_update properly

2018-01-27 Thread Coly Li
s (e.g. hold dc->count, or use locks), this is the only way I can find which works to properly stop dc->writeback_rate_update delayed work. Changelog: v2: Try to fix the race issue which is pointed out by Junhui. v1: The initial version for review Signed-off-by: Coly Li <col...@suse.de> Cc

[PATCH v4 06/13] bcache: set error_limit correctly

2018-01-27 Thread Coly Li
ense, it is enough for most of cache devices. Changelog: v2: add reviewed-by from Hannes. v1: initial version for review. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Tang Junhui <tang.jun...@zte.com.cn> Cc: Junhui Tang &l

[PATCH v4 00/13] bcache: device failure handling improvement

2018-01-28 Thread Coly Li
fix detach issue find in v2 patch set. v2: fixes all problems found in v1 review. add patches to handle backing device failure. add one more patch to set writeback_rate_update_seconds range. include a patch from Junhui Tang. v1: the initial version, only handles cache device failure. Col

[PATCH v4 11/13] bcache: add io_disable to struct cached_dev

2018-01-27 Thread Coly Li
ing device is broken of disconnected, and I/O errors reach its error limit, backing device will be disabled and the associated bcache device will be removed from system. Changelog: v2: indeed this is new added in v2 patch set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Re

Re: [PATCH v4 13/13] bcache: add stop_when_cache_set_failed to struct cached_dev

2018-01-28 Thread Coly Li
more complicated. OK, I get your point, it makes sense. This is just a rough thought from me, the motivation was to avoid on-disk format change. > > Is there a way to save the option somewhere in bcache superblock, like the > cache mode is saved? > It is possible to add flag in bcache superblock, but it means on disk format modification, this is something I try best to avoid. I need to check the code before I have the answer of yes or no. >> How do you think of this ? > > Actually, I'd love to hear thoughts from other users and developers. Three > opinions is too few for this kind of discussion. Sure I agree. Indeed the suggestion and feedback for you and Nix helps me quite a lot :-) Firstly I try to avoid data corruption and provide flexibility to enterprise and personal users, then we can improve it in future if someone may provide better suggestion than yours :-) Thanks. Coly Li

[PATCH v4 07/13] bcache: add CACHE_SET_IO_DISABLE to struct cache_set flags

2018-01-28 Thread Coly Li
Changelog v2, more changes by previous review, - Use CACHE_SET_IO_DISABLE of cache_set->flags, suggested by Junhui. - Check CACHE_SET_IO_DISABLE in bch_btree_gc() to stop a while-loop, this is reported and inspired from origal patch of Pavel Vazharov. v1, initial version. Signed-off-by: Coly Li

Re: [PATCH v4 05/13] bcache: stop dc->writeback_rate_update properly

2018-01-29 Thread Coly Li
EV_WB_RUNNING4 > +#define BCACHE_DEV_RATE_DW_RUNNING8 > Would be OK just as: > +#define BCACHE_DEV_WB_RUNNING3 > +#define BCACHE_DEV_RATE_DW_RUNNING4 > > Reviewed-by: Tang Junhui <tang.jun...@zte.com.cn> > Hi Junhui, I will fix that in v5 patch. Thanks for your review :-) Coly Li [snip]

[PATCH v4 07/13] bcache: add CACHE_SET_IO_DISABLE to struct cache_set flags

2018-01-28 Thread Coly Li
Changelog v2, more changes by previous review, - Use CACHE_SET_IO_DISABLE of cache_set->flags, suggested by Junhui. - Check CACHE_SET_IO_DISABLE in bch_btree_gc() to stop a while-loop, this is reported and inspired from origal patch of Pavel Vazharov. v1, initial version. Signed-off-by: Coly Li

[PATCH v5 05/10] bcache: add CACHE_SET_IO_DISABLE to struct cache_set flags

2018-02-05 Thread Coly Li
gc() to stop a while-loop, this is reported and inspired from origal patch of Pavel Vazharov. v1, initial version. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@l

[PATCH v5 07/10] bcache: fix inaccurate io state for detached bcache devices

2018-02-05 Thread Coly Li
d_dev_get(dc)) { //will callback generic_end_io_acct() } else { //will not call generic_end_io_acct() } This patch calls generic_end_io_acct() in the end of IO for detached devices, so we can show IO state correctly. (Modified to use GFP_NOIO in kzalloc() by Coly Li) Signed-off-by: Tang Junh

[PATCH v5 08/10] bcache: add backing_request_endio() for bi_end_io of attached backing device I/O

2018-02-05 Thread Coly Li
a redundant bch_writeback_add() line added in v4 patch set. v1: indeed this is new added in this patch set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- dri

[PATCH v5 03/10] bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set

2018-02-05 Thread Coly Li
compose a separte patch because that patch "bcache: fix cached_dev->count usage for bch_cache_set_error()" already gets a "Reviewed-by:" from Hannes Reinecke. Also this fix is not trivial and good for a separate patch. Signed-off-by: Coly Li <col...@suse.de> Cc: Michael Lyle &l

[PATCH v5 04/10] bcache: stop dc->writeback_rate_update properly

2018-02-05 Thread Coly Li
e which is pointed out by Junhui. v1: The initial version for review Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke <h...@suse.com> --- drivers/md/bcache/bc

[PATCH v5 01/10] bcache: set writeback_rate_update_seconds in range [1, 60] seconds

2018-02-05 Thread Coly Li
to decide a reasonable small timeout. This patch limits sysfs interface to set dc->writeback_rate_update_seconds in range of [1, 60] seconds, and replaces the hand-coded number by macros. Changelog: v2: fix a rebase typo in v4, which is pointed out by Michael Lyle. v1: initial version. Signed-

[PATCH v5 02/10] bcache: fix cached_dev->count usage for bch_cache_set_error()

2018-02-05 Thread Coly Li
or system reboot, cached_dev->count can always be used correctly. The patch is simple, but understanding how it works is quite complicated. Changelog: v2: set dc->writeback_thread to NULL in this patch, as suggested by Hannes. v1: initial version for review. Signed-off-by: Coly Li <

[PATCH v5 00/10] bcache: device failure handling improvement

2018-02-05 Thread Coly Li
issue find in v2 patch set. v2: fixes all problems found in v1 review. add patches to handle backing device failure. add one more patch to set writeback_rate_update_seconds range. include a patch from Junhui Tang. v1: the initial version, only handles cache device failure. Coly Li Coly L

[PATCH v5 09/10] bcache: add io_disable to struct cached_dev

2018-02-05 Thread Coly Li
e. v1: indeed this is new added in v2 patch set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Michael Lyle <ml...@lyle.org> Cc: Junhui Tang <tang.jun...@zte.com.cn> --- drivers/md/bcache/bcache.h | 6 ++ drivers/md/bcache/i

[PATCH v5 10/10] bcache: stop bcache device when backing device is offline

2018-02-05 Thread Coly Li
sers need to recovery the backing device, register and attach it manually. Changelog: v2: remove "bcache: " prefix when calling pr_warn(). v1: initial version. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Michael Lyle <ml...@l

Re: [PATCH v5 06/10] bcache: add stop_when_cache_set_failed option to backing device

2018-02-06 Thread Coly Li
On 06/02/2018 6:50 PM, Nix wrote: > On 6 Feb 2018, Coly Li verbalised: >> diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h >> index 7917b3820dd5..263164490833 100644 >> --- a/drivers/md/bcache/bcache.h >> +++ b/drivers/md/bcache/bcache.h >&g

[PATCH v5 06/10] bcache: add stop_when_cache_set_failed option to backing device

2018-02-06 Thread Coly Li
ice. Changelog: v3: fix typos pointed out by Nix. v2: change option values of stop_when_cache_set_failed from 1/0 to "auto"/"always". v1: initial version, stop_when_cache_set_failed can be 0 (not stop) or 1 (always stop). Signed-off-by: Coly Li <col...@suse.de> Cc: N

[PATCH v6 3/9] bcache: stop dc->writeback_rate_update properly

2018-02-08 Thread Coly Li
e which is pointed out by Junhui. v1: The initial version for review Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> Cc: Hannes Reinecke <h...@suse.com> --- drivers/md/bcache/bc

[PATCH v6 2/9] bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set

2018-02-08 Thread Coly Li
compose a separte patch because that patch "bcache: fix cached_dev->count usage for bch_cache_set_error()" already gets a "Reviewed-by:" from Hannes Reinecke. Also this fix is not trivial and good for a separate patch. Signed-off-by: Coly Li <col...@suse.de>

[PATCH v6 0/9] bcache: device failure handling improvement

2018-02-08 Thread Coly Li
, only handles cache device failure. Coly Li --- Coly Li (8): bcache: fix cached_dev->count usage for bch_cache_set_error() bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set bcache: stop dc->writeback_rate_update properly bcache: add CACHE_SET_IO_DISABLE to struct

[PATCH v6 1/9] bcache: fix cached_dev->count usage for bch_cache_set_error()

2018-02-08 Thread Coly Li
or system reboot, cached_dev->count can always be used correctly. The patch is simple, but understanding how it works is quite complicated. Changelog: v2: set dc->writeback_thread to NULL in this patch, as suggested by Hannes. v1: initial version for review. Signed-off-by: Coly Li <

[PATCH v6 7/9] bcache: add backing_request_endio() for bi_end_io of attached backing device I/O

2018-02-08 Thread Coly Li
a redundant bch_writeback_add() line added in v4 patch set. v1: indeed this is new added in this patch set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@lyle.org> --- dri

[PATCH v6 6/9] bcache: fix inaccurate io state for detached bcache devices

2018-02-08 Thread Coly Li
d_dev_get(dc)) { //will callback generic_end_io_acct() } else { //will not call generic_end_io_acct() } This patch calls generic_end_io_acct() in the end of IO for detached devices, so we can show IO state correctly. (Modified to use GFP_NOIO in kzalloc() by Coly Li) Changelog: v2:

[PATCH v6 5/9] bcache: add stop_when_cache_set_failed option to backing device

2018-02-08 Thread Coly Li
ice. Changelog: v3: fix typos pointed out by Nix. v2: change option values of stop_when_cache_set_failed from 1/0 to "auto"/"always". v1: initial version, stop_when_cache_set_failed can be 0 (not stop) or 1 (always stop). Signed-off-by: Coly Li <col...@suse.de> Review

[PATCH v6 9/9] bcache: stop bcache device when backing device is offline

2018-02-08 Thread Coly Li
sers need to recovery the backing device, register and attach it manually. Changelog: v2: remove "bcache: " prefix when calling pr_warn(). v1: initial version. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Michael Lyle <ml...@l

[PATCH v6 8/9] bcache: add io_disable to struct cached_dev

2018-02-08 Thread Coly Li
e. v1: indeed this is new added in v2 patch set. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Michael Lyle <ml...@lyle.org> Cc: Junhui Tang <tang.jun...@zte.com.cn> --- drivers/md/bcache/bcache.h | 6 ++ drivers/md/bcache/i

[PATCH v6 4/9] bcache: add CACHE_SET_IO_DISABLE to struct cache_set flags

2018-02-08 Thread Coly Li
gc() to stop a while-loop, this is reported and inspired from origal patch of Pavel Vazharov. v1, initial version. Signed-off-by: Coly Li <col...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Junhui Tang <tang.jun...@zte.com.cn> Cc: Michael Lyle <ml...@l

Re: [PATCH] bcache: fix unmatched generic_end_io_acct() & generic_start_io_acct()

2018-01-02 Thread Coly Li
ng. > > This patch fix the problem by calling generic_end_io_acct() with > (struct bcache_device)->disk. > > Signed-off-by: Zhai Zhaoxuan <kxuan...@gmail.com> Hi Zhaoxuan, Nice catch, it makes sense. Thanks. Reviewed-by: Coly Li <col...@suse.de> One more question,

Re: [PATCH] bcache: fix unmatched generic_end_io_acct() & generic_start_io_acct()

2018-01-02 Thread Coly Li
On 03/01/2018 3:05 PM, Zhaoxuan wrote: > > On 03/01/2018 13:45 PM, Coly Li wrote: >> On 03/01/2018 12:39 PM, Zhai Zhaoxuan wrote: >>> The function cached_dev_make_request() and flash_dev_make_request() call >>> generic_start_io_acct() with (struct bcache_dev

Re: [for-416 PATCH 3/3] bcache: allow quick writeback when backing idle

2018-01-03 Thread Coly Li
han current idle writeback, but half as fast as writeback with full > device utilization. > Nice performance data! > With only one I/O outstanding at a time, if front-end I/O starts latency > for the first request is still good. It is good idea, I like it. Acked-by: Coly Li <col...@suse.de> Thanks for the effort :-) Coly Li

Re: [PATCH v1 05/10] bcache: stop dc->writeback_rate_update if cache set is stopping

2018-01-03 Thread Coly Li
onds after cancel_delayed_work_sync() called, a NULL pointer difference oops happens. Cache set memory is freed within 2 seconds after __cache_set_unregister() called, so inside __update_writeback_rate() struct cache_set is referenced and causes the NULL pointer deference bug. There are s

Re: [PATCH v1 00/10] cache device failure handling improvement

2018-01-03 Thread Coly Li
On 04/01/2018 1:07 AM, Michael Lyle wrote: > Hey Coly, > > On 01/03/2018 06:03 AM, Coly Li wrote: > [snip] >> The first 8 patches of this patch set is to fix existing bugs in bcache, >> the last 2 patches do the real improvement. Order of applying these patches >&g

Re: [PATCH v1 05/10] bcache: stop dc->writeback_rate_update if cache set is stopping

2018-01-04 Thread Coly Li
c->caching is still hold and cache set memory will only be freed after cancel_delayed_work_sync() returns and refcount of c->caching dropped. And in cached_dev_free(), bcache_device_free() and kobject_put(>disk.kobj) are called after cancel_delayed_work_sync() returns. Therefore when update_writeback_rate() is executing and accessing c->flgas inside, memory of cache_set, bcache_device and cached_dev are all there. This is why it is safe ;-) Coly Li

Re: [PATCH 8/9] bcache: initiate bcache_debug to NULL

2018-07-27 Thread Coly Li
On 2018/7/28 3:32 AM, Noah Massey wrote: > On Fri, Jul 27, 2018 at 1:37 PM Noah Massey wrote: >> On Thu, Jul 26, 2018, 10:23 AM Coly Li wrote: >>> >>> Global variable bcache_debug is firstly initialized in bch_debug_init(), >>> and destroyed in bch_debu

Re: [PATCH v2] bcache: set max writeback rate when I/O request is idle

2018-07-26 Thread Coly Li
On 2018/7/26 1:44 PM, Stefan Priebe - Profihost AG wrote: >> Am 25.07.2018 um 08:16 schrieb Stefan Priebe - Profihost AG >> : >> >>> Am 24.07.2018 um 18:36 schrieb Coly Li: >>>> On 2018/7/24 4:33 PM, Stefan Priebe - Profihost AG wrote: >>>>>

[PATCH 9/9] bcache: stop using the deprecated get_seconds()

2018-07-25 Thread Coly Li
an updated format in the future it can be fixed. We still have a long time before the overflow and checking the tools at https://github.com/koverstreet/bcache-tools reveals no access to any of them. Signed-off-by: Arnd Bergmann Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 12

[PATCH 6/9] bcache: free heap cache_set->flush_btree in bch_journal_free

2018-07-25 Thread Coly Li
From: Shenghui Wang Free the cache_set->flush_bree heap memory on journal free. Signed-off-by: Wang Sheng-Hui Signed-off-by: Coly Li --- drivers/md/bcache/journal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c in

[PATCH 7/9] bcache: do not assign in if condition in bcache_init()

2018-07-25 Thread Coly Li
From: Florian Schmaus Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff

[PATCH 4/9] bcache: fix I/O significant decline while backend devices registering

2018-07-25 Thread Coly Li
data of the device in an incremental way, and do not block other cached devices all the time. Patch v2: Rename some variables and macros name as Coly suggested. Signed-off-by: Tang Junhui Signed-off-by: Coly Li --- drivers/md/bcache/writeback.c | 29 ++--- 1 file changed

[PATCH 5/9] bcache: do not assign in if condition register_bcache()

2018-07-25 Thread Coly Li
From: Florian Schmaus Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCH 0/9] bcache patches for Linux v4.19

2018-07-25 Thread Coly Li
are for recoganized performance improvement, these patches are posted for monthes and good to me. Please pick the first wave for 4.19. Thanks in advance. Coly Li --- Arnd Bergmann (1): bcache: stop using the deprecated get_seconds() Florian Schmaus (3): bcache: do not assign in if condition

[PATCH 1/9] bcache: simplify the calculation of the total amount of flash dirty data

2018-07-25 Thread Coly Li
of flash only devices dirty data in real time, so we didn't need to calculate the total amount of dirty data any more. Signed-off-by: Tang Junhui Signed-off-by: Coly Li --- drivers/md/bcache/bcache.h| 1 + drivers/md/bcache/super.c | 2 ++ drivers/md/bcache/writeback.c | 5

[PATCH 3/9] bcache: calculate the number of incremental GC nodes according to the total of btree nodes

2018-07-25 Thread Coly Li
ocess more nodes each time, otherwise GC will process less nodes each time (but no less than MIN_GC_NODES). Signed-off-by: Tang Junhui Signed-off-by: Coly Li --- drivers/md/bcache/btree.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/

[PATCH 2/9] bcache: finish incremental GC

2018-07-25 Thread Coly Li
are not blocked all the time, and there is no obvious I/Os zero jump problem any more. Patch v2: Rename some variables and macros name as Coly suggested. Signed-off-by: Tang Junhui Signed-off-by: Coly Li --- drivers/md/bcache/bcache.h | 5 + drivers/md/bcache/btree.c | 14 +- drivers/md

[PATCH 8/9] bcache: do not assign in if condition in bcache_device_init()

2018-07-25 Thread Coly Li
From: Florian Schmaus Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions

[PATCH v3] bcache: set max writeback rate when I/O request is idle

2018-07-26 Thread Coly Li
he: allow quick writeback when backing idle") Cc: sta...@vger.kernel.org #4.16+ Signed-off-by: Coly Li Tested-by: Kai Krakow Cc: Michael Lyle Cc: Stefan Priebe --- Channgelog: v3, Do not acquire bch_register_lock in set_at_max_writeback_rate(). v2, Fix a deadlock reported by Stefan Priebe.

Re: [PATCH v3] bcache: set max writeback rate when I/O request is idle

2018-07-26 Thread Coly Li
On 2018/7/26 7:49 PM, Stefan Priebe - Profihost AG wrote: > Am 26.07.2018 um 12:42 schrieb Coly Li: >> 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 >> bcache device.

[PATCH 6/9] bcache: fix mistaken comments in bch_keylist_realloc()

2018-07-26 Thread Coly Li
--- 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 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -107,7 +107,7 @@ static int

[PATCH 8/9] bcache: initiate bcache_debug to NULL

2018-07-26 Thread Coly Li
l varabile bcache_debug to be NULL, to make the failure code path to be predictable. Signed-off-by: Coly Li --- drivers/md/bcache/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 57f8f5aeee55..24b0eb65d

[PATCH 7/9] bcache: add code comments for bset.c

2018-07-26 Thread Coly Li
from me misrepresentation. Signed-off-by: Coly Li --- drivers/md/bcache/bset.c | 63 1 file changed, 63 insertions(+) diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c index f3403b45bc28..596c93b44e9b 100644 --- a/drivers/md/bcache/bset.c

[PATCH 1/9] bcache: do not check return value of debugfs_create_dir()

2018-07-26 Thread Coly Li
() and closure_debug_init(). This patch changes these two functions from int to void type, and ignore return values of debugfs_create_dir(). This patch does not fix exact bug, just makes things work as they should. Signed-off-by: Coly Li Suggested-by: Greg Kroah-Hartman Cc: Kai Krakow Cc: Kent

[PATCH 0/9] Pending bcache patches for review

2018-07-26 Thread Coly Li
Hi folks, I ask for help to review these patches, some of them are posted for months. They are OK with my test for a while, still tt would be great to have more reviewer before these patches go into v4.19. Thanks in advance. Coly Li --- Coly Li (9): bcache: do not check return value

<    1   2   3   4   5   6   >