[PATCH v2 10/17] bcache: prefer 'help' in Kconfig

2018-08-10 Thread Coly Li
Current bcache Kconfig uses '---help---' as header of help information, for now 'help' is prefered. This patch fixes this style by replacing '---help---' by 'help' in bcache Kconfig file. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcac

[PATCH v2 08/17] bcache: replace '%pF' by '%pS' in seq_printf()

2018-08-10 Thread Coly Li
'%pF' and '%pf' are deprecated vsprintf pointer extensions, this patch replace them by '%pS', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/closure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v2 05/17] bcache: replace Symbolic permissions by octal permission numbers

2018-08-10 Thread Coly Li
Symbolic permission names are used in bcache, for now octal permission numbers are encouraged to use for readability. This patch replaces all symbolic permissions by octal permission numbers. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/bcache.h | 4 ++-- drivers/md/bcache

[PATCH v2 09/17] bcache: fix typo 'succesfully' to 'successfully'

2018-08-10 Thread Coly Li
This patch fixes typo 'succesfully' to correct 'successfully', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/io.c | 2 +- drivers/md/bcache/request.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) dif

[PATCH v2 13/17] bcache: add static const prefix to char * array declarations

2018-08-10 Thread Coly Li
This patch declares char * array with const prefix in sysfs.c, which is suggested by checkpatch.pl. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c

[PATCH v2 12/17] bcache: fix code comments style

2018-08-10 Thread Coly Li
This patch fixes 3 style issues warned by checkpatch.pl, - Comment lines are not aligned - Comments use "/*" on subsequent lines - Comment lines use a trailing "*/" Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/bset.c | 9 ++--- drivers/md/bca

[PATCH v2 16/17] bcache: remove unnecessary space before ioctl function pointer arguments

2018-08-10 Thread Coly Li
This is warned by checkpatch.pl, this patch removes the extra space. Signed-off-by: Coly Li Cc: Shenghui Wang --- 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 66e6d5639b38

[PATCH v2 14/17] bcache: move open brace at end of function definitions to next line

2018-08-10 Thread Coly Li
This is not a preferred style to place open brace '{' at the end of function definition, checkpatch.pl reports error for such coding style. This patch moves them into the start of the next new line. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/super.c | 9 ++-

[PATCH v2 15/17] bcache: add missing SPDX header

2018-08-10 Thread Coly Li
The SPDX header is missing fro closure.c, super.c and util.c, this patch adds SPDX header for GPL-2.0 into these files. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/closure.c | 1 + drivers/md/bcache/super.c | 1 + drivers/md/bcache/util.c| 1 + 3 files changed, 3

[PATCH v2 17/17] bcache: add the missing comments for smp_mb()/smp_wmb()

2018-08-10 Thread Coly Li
Checkpatch.pl warns there are 2 locations of smp_mb() and smp_wmb() without code comment. This patch adds the missing code comments for these memory barrier calls. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/closure.h | 4 +++- drivers/md/bcache/super.c | 2 +- 2 files

Re: [PATCH v2 03/17] bcache: add identifier names to arguments of function definitions

2018-08-10 Thread Coly Li
On 2018/8/10 4:26 PM, shenghui wrote: > > > On 08/10/2018 03:23 PM, Coly Li wrote: >> There are many function definitions do not have identifier argument names, >> scripts/checkpatch.pl complains warnings like this, >> >> WARNING: function definition argumen

[PATCH] bcache: fix 0day error of setting writeback_rate by sysfs interface

2018-08-10 Thread Coly Li
ert the input buffer into a long int type result. Fixes: Commit ea8c5356d390 ("bcache: set max writeback rate when I/O request is idle") Signed-off-by: Coly Li Cc: sta...@vger.kernel.org #4.16+ Cc: Kai Krakow Cc: Stefan Priebe --- drivers/md/bcache/sysfs.c | 13 ++--- 1 f

[PATCH v3 00/17] fixes reported by checkpatch.pl

2018-08-10 Thread Coly Li
limit. Thanks in advance for any comment or review. Changelog: v3: Fix coments from Shenghui Wang. v2: Fix comments from Shenghui Wang. v1: Initial version Coly Li --- Coly Li (17): bcache: style fix to replace 'unsigned' by 'unsigned int' bcache: style fix to add a blan

[PATCH v3 03/17] bcache: add identifier names to arguments of function definitions

2018-08-10 Thread Coly Li
dirty_init(struct bcache_device *); This patch adds identifier argument names to all bcache function definitions to fix such warnings. Signed-off-by: Coly Li Cc: Shenghui Wang --- drivers/md/bcache/bcache.h| 112 +++--- drivers/md/bcache/bset.h

[PATCH v3 01/17] bcache: style fix to replace 'unsigned' by 'unsigned int'

2018-08-10 Thread Coly Li
This patch fixes warning reported by checkpatch.pl by replacing 'unsigned' with 'unsigned int'. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/alloc.c | 36 ++- drivers/md/bcache/bcache.h| 107 +++ driv

[PATCH v3 02/17] bcache: style fix to add a blank line after declarations

2018-08-10 Thread Coly Li
Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/alloc.c | 3 +++ drivers/md/bcache/bcache.h| 1 + drivers/md/bcache/bset.c | 5 - drivers/md/bcache/btree.c | 7 +++ drivers/md/bcache/closure.c | 1 + drivers/md/bcache/debug.c | 4

[PATCH v3 06/17] bcache: replace printk() by pr_*() routines

2018-08-10 Thread Coly Li
There are still many places in bcache use printk to display kernel message, which are suggested to be preplaced by pr_*() routines like pr_err(), pr_info(), or pr_notice(). This patch replaces all printk() with a proper pr_*() routine for bcache code. Signed-off-by: Coly Li Reviewed-by

[PATCH v3 05/17] bcache: replace Symbolic permissions by octal permission numbers

2018-08-10 Thread Coly Li
Symbolic permission names are used in bcache, for now octal permission numbers are encouraged to use for readability. This patch replaces all symbolic permissions by octal permission numbers. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/bcache.h | 4 ++-- drivers/md

[PATCH v3 04/17] bcache: style fixes for lines over 80 characters

2018-08-10 Thread Coly Li
This patch fixes the lines over 80 characters into more lines, to minimize warnings by checkpatch.pl. There are still some lines exceed 80 characters, but it is better to be a single line and I don't change them. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/bca

[PATCH v3 07/17] bcache: fix indent by replacing blank by tabs

2018-08-10 Thread Coly Li
bch_btree_insert_check_key() has unaligned indent, or indent by blank characters. This patch makes the indent aligned and replace blank by tabs. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/btree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v3 08/17] bcache: replace '%pF' by '%pS' in seq_printf()

2018-08-10 Thread Coly Li
'%pF' and '%pf' are deprecated vsprintf pointer extensions, this patch replace them by '%pS', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/closure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH v3 09/17] bcache: fix typo 'succesfully' to 'successfully'

2018-08-10 Thread Coly Li
This patch fixes typo 'succesfully' to correct 'successfully', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/io.c | 2 +- drivers/md/bcache/request.c | 2 +- 2 files changed, 2 insertions(+), 2 deleti

[PATCH v3 10/17] bcache: prefer 'help' in Kconfig

2018-08-10 Thread Coly Li
Current bcache Kconfig uses '---help---' as header of help information, for now 'help' is prefered. This patch fixes this style by replacing '---help---' by 'help' in bcache Kconfig file. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/b

[PATCH v3 12/17] bcache: fix code comments style

2018-08-10 Thread Coly Li
This patch fixes 3 style issues warned by checkpatch.pl, - Comment lines are not aligned - Comments use "/*" on subsequent lines - Comment lines use a trailing "*/" Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/bset.c | 9 ++--- drive

[PATCH v3 11/17] bcache: do not check NULL pointer before calling kmem_cache_destroy

2018-08-10 Thread Coly Li
kmem_cache_destroy() is safe for NULL pointer as input, the NULL pointer checking is unncessary. This patch just removes the NULL pointer checking to make code simpler. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/request.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH v3 17/17] bcache: add the missing comments for smp_mb()/smp_wmb()

2018-08-10 Thread Coly Li
Checkpatch.pl warns there are 2 locations of smp_mb() and smp_wmb() without code comment. This patch adds the missing code comments for these memory barrier calls. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/closure.h | 4 +++- drivers/md/bcache/super.c | 2 +- 2

[PATCH v3 14/17] bcache: move open brace at end of function definitions to next line

2018-08-10 Thread Coly Li
This is not a preferred style to place open brace '{' at the end of function definition, checkpatch.pl reports error for such coding style. This patch moves them into the start of the next new line. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/s

[PATCH v3 13/17] bcache: add static const prefix to char * array declarations

2018-08-10 Thread Coly Li
This patch declares char * array with const prefix in sysfs.c, which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache

[PATCH v3 15/17] bcache: add missing SPDX header

2018-08-10 Thread Coly Li
The SPDX header is missing fro closure.c, super.c and util.c, this patch adds SPDX header for GPL-2.0 into these files. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/closure.c | 1 + drivers/md/bcache/super.c | 1 + drivers/md/bcache/util.c| 1 + 3 files changed

[PATCH v3 16/17] bcache: remove unnecessary space before ioctl function pointer arguments

2018-08-10 Thread Coly Li
This is warned by checkpatch.pl, this patch removes the extra space. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- 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

Re: [PATCH] bcache: fix 0day error of setting writeback_rate by sysfs interface

2018-08-10 Thread Coly Li
set by sysfs interface, because sysfs_strtoul_clamp() directly returns. This patch fixes this and allows writeback_rate can be manually set again. Coly Li > > Am 10.08.2018 um 17:45 schrieb Coly Li: >> Commit ea8c5356d390 ("bcache: set max writeback rate when I/O request >

Re: [PATCH] bcache: fix 0day error of setting writeback_rate by sysfs interface

2018-08-10 Thread Coly Li
On 2018/8/11 2:19 AM, Jens Axboe wrote: > On 8/10/18 9:45 AM, Coly Li wrote: >> Commit ea8c5356d390 ("bcache: set max writeback rate when I/O request >> is idle") changes struct bch_ratelimit member rate from uint32_t to >> atomic_long_t and uses atomic_long_set

[PATCH v3 02/17] bcache: style fix to add a blank line after declarations

2018-08-10 Thread Coly Li
Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/alloc.c | 3 +++ drivers/md/bcache/bcache.h| 1 + drivers/md/bcache/bset.c | 5 - drivers/md/bcache/btree.c | 7 +++ drivers/md/bcache/closure.c | 1 + drivers/md/bcache/debug.c | 4

[PATCH v3 00/17] bcache for 4.19, 3rd wave

2018-08-10 Thread Coly Li
line limit. Thanks in advance for any comment or review. Changelog: v3: Fix coments from Shenghui Wang. v2: Fix comments from Shenghui Wang. v1: Initial version Coly Li --- Coly Li (17): bcache: style fix to replace 'unsigned' by 'unsigned int' bcache: style fix

[PATCH v3 06/17] bcache: replace printk() by pr_*() routines

2018-08-10 Thread Coly Li
There are still many places in bcache use printk to display kernel message, which are suggested to be preplaced by pr_*() routines like pr_err(), pr_info(), or pr_notice(). This patch replaces all printk() with a proper pr_*() routine for bcache code. Signed-off-by: Coly Li Reviewed-by

[PATCH v3 03/17] bcache: add identifier names to arguments of function definitions

2018-08-10 Thread Coly Li
dirty_init(struct bcache_device *); This patch adds identifier argument names to all bcache function definitions to fix such warnings. Signed-off-by: Coly Li Reviewed: Shenghui Wang --- drivers/md/bcache/bcache.h| 112 +++--- drivers/md/bcache/bset.h

[PATCH v3 01/17] bcache: style fix to replace 'unsigned' by 'unsigned int'

2018-08-10 Thread Coly Li
This patch fixes warning reported by checkpatch.pl by replacing 'unsigned' with 'unsigned int'. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/alloc.c | 36 ++- drivers/md/bcache/bcache.h| 107 +++ driv

[PATCH v3 05/17] bcache: replace Symbolic permissions by octal permission numbers

2018-08-10 Thread Coly Li
Symbolic permission names are used in bcache, for now octal permission numbers are encouraged to use for readability. This patch replaces all symbolic permissions by octal permission numbers. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/bcache.h | 4 ++-- drivers/md

[PATCH v3 04/17] bcache: style fixes for lines over 80 characters

2018-08-10 Thread Coly Li
This patch fixes the lines over 80 characters into more lines, to minimize warnings by checkpatch.pl. There are still some lines exceed 80 characters, but it is better to be a single line and I don't change them. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/bca

[PATCH v3 07/17] bcache: fix indent by replacing blank by tabs

2018-08-10 Thread Coly Li
bch_btree_insert_check_key() has unaligned indent, or indent by blank characters. This patch makes the indent aligned and replace blank by tabs. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/btree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v3 17/17] bcache: add the missing comments for smp_mb()/smp_wmb()

2018-08-10 Thread Coly Li
Checkpatch.pl warns there are 2 locations of smp_mb() and smp_wmb() without code comment. This patch adds the missing code comments for these memory barrier calls. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/closure.h | 4 +++- drivers/md/bcache/super.c | 2 +- 2

[PATCH v3 13/17] bcache: add static const prefix to char * array declarations

2018-08-10 Thread Coly Li
This patch declares char * array with const prefix in sysfs.c, which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache

[PATCH v3 08/17] bcache: replace '%pF' by '%pS' in seq_printf()

2018-08-10 Thread Coly Li
'%pF' and '%pf' are deprecated vsprintf pointer extensions, this patch replace them by '%pS', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/closure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH v3 09/17] bcache: fix typo 'succesfully' to 'successfully'

2018-08-10 Thread Coly Li
This patch fixes typo 'succesfully' to correct 'successfully', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/io.c | 2 +- drivers/md/bcache/request.c | 2 +- 2 files changed, 2 insertions(+), 2 deleti

[PATCH v3 12/17] bcache: fix code comments style

2018-08-10 Thread Coly Li
This patch fixes 3 style issues warned by checkpatch.pl, - Comment lines are not aligned - Comments use "/*" on subsequent lines - Comment lines use a trailing "*/" Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/bset.c | 9 ++--- drive

[PATCH v3 10/17] bcache: prefer 'help' in Kconfig

2018-08-10 Thread Coly Li
Current bcache Kconfig uses '---help---' as header of help information, for now 'help' is prefered. This patch fixes this style by replacing '---help---' by 'help' in bcache Kconfig file. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/b

[PATCH v3 16/17] bcache: remove unnecessary space before ioctl function pointer arguments

2018-08-10 Thread Coly Li
This is warned by checkpatch.pl, this patch removes the extra space. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- 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

[PATCH v3 14/17] bcache: move open brace at end of function definitions to next line

2018-08-10 Thread Coly Li
This is not a preferred style to place open brace '{' at the end of function definition, checkpatch.pl reports error for such coding style. This patch moves them into the start of the next new line. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/s

[PATCH v3 15/17] bcache: add missing SPDX header

2018-08-10 Thread Coly Li
The SPDX header is missing fro closure.c, super.c and util.c, this patch adds SPDX header for GPL-2.0 into these files. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/closure.c | 1 + drivers/md/bcache/super.c | 1 + drivers/md/bcache/util.c| 1 + 3 files changed

[PATCH v3 11/17] bcache: do not check NULL pointer before calling kmem_cache_destroy

2018-08-10 Thread Coly Li
kmem_cache_destroy() is safe for NULL pointer as input, the NULL pointer checking is unncessary. This patch just removes the NULL pointer checking to make code simpler. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang --- drivers/md/bcache/request.c | 3 +-- 1 file changed, 1 insertion(+), 2

Re: [PATCH v3 00/17] bcache for 4.19, 3rd wave

2018-08-10 Thread Coly Li
On 2018/8/11 1:19 PM, Coly Li wrote: > Hi Jens, > > This series contains several minor fixes and code cleanup reported by > scripts/checkpatch.pl. After this series, there are still a few warning > from checkpatch.pl, but I think they are necessary to be the way they > are and

Re: [PATCH v3 00/17] bcache for 4.19, 3rd wave

2018-08-11 Thread Coly Li
On 2018/8/12 5:42 AM, Jens Axboe wrote: > On 8/10/18 11:19 PM, Coly Li wrote: >> Hi Jens, >> >> This series contains several minor fixes and code cleanup reported by >> scripts/checkpatch.pl. After this series, there are still a few warning >> from checkpatch.pl,

Re: [PATCH] bcache: fix 0day error of setting writeback_rate by sysfs interface

2018-08-12 Thread Coly Li
On 2018/8/12 11:10 PM, Jens Axboe wrote: > On 8/10/18 10:49 PM, Coly Li wrote: >> On 2018/8/11 2:19 AM, Jens Axboe wrote: >>> On 8/10/18 9:45 AM, Coly Li wrote: >>>> Commit ea8c5356d390 ("bcache: set max writeback rate when I/O request >>>> is idle&

Re: [PATCH 1/1] bcache: release the lock before stopping the writeback thread

2018-08-22 Thread Coly Li
quot; when I apply this patch. > > Signed-off-by: Shan Hai Nice catch! This one should go to stable trees since 4.17 as well. I will CC stable maintainers when I submit this one for 4.19. Thank you for the fix. Coly Li > --- > drivers/md/bcache/writeback.c | 4 +++- > 1 file chang

[PATCH] bcache: release dc->writeback_lock properly in bch_writeback_thread()

2018-08-22 Thread Coly Li
From: Shan Hai The writeback thread would exit with a lock held when the cache device is detached via sysfs interface, fix it by releasing the held lock before exiting the while-loop. Signed-off-by: Shan Hai Signed-off-by: Coly Li Tested-by: Shenghui Wang Cc: sta...@vger.kernel.org #4.17

[PATCH v2] bcache: release dc->writeback_lock properly in bch_writeback_thread()

2018-08-22 Thread Coly Li
han Hai Signed-off-by: Coly Li Tested-by: Shenghui Wang Cc: sta...@vger.kernel.org #4.17+ --- Changelog: v2: add Fixes tag by Coly Li. v1: initial patch from Shan Hai. drivers/md/bcache/writeback.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/writeback.

Re: [PATCH v2] bcache: release dc->writeback_lock properly in bch_writeback_thread()

2018-08-22 Thread Coly Li
On 2018/8/23 2:02 AM, Coly Li wrote: > From: Shan Hai > > The writeback thread would exit with a lock held when the cache device is > detached via sysfs interface, fix it by releasing the held lock before exiting > the while-loop. > > Fixes: fadd94e05c02 (bcache: quit dc-&

[PATCH] bcache: use REQ_PRIO to indicate bio for metadata

2018-09-25 Thread Coly Li
file system code. This patch replaces REQ_META with correct flag REQ_PRIO. CC Adam Manzanares because he explains to me what REQ_PRIO is for. Signed-off-by: Coly Li Cc: Adam Manzanares --- drivers/md/bcache/request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH] bcache: use REQ_PRIO to indicate bio for metadata

2018-09-25 Thread Coly Li
On 9/26/18 12:32 AM, Adam Manzanares wrote: On 9/25/18 9:12 AM, Coly Li wrote: In cached_dev_cache_miss() and check_should_bypass(), REQ_META is used to check whether a bio is for metadata request. REQ_META is used for blktrace, the correct REQ_ flag should be REQ_PRIO. This flag means the

[PATCH 0/1] bcache fix for 4.19-rc6

2018-09-27 Thread Coly Li
cool to have it in this run. Thanks. Coly Li guoju (1): bcache: add separate workqueue for journal_write to avoid deadlock drivers/md/bcache/bcache.h | 1 + drivers/md/bcache/journal.c | 6 +++--- drivers/md/bcache/super.c | 8 3 files changed, 12 insertions(+), 3 deletions

[PATCH 1/1] bcache: add separate workqueue for journal_write to avoid deadlock

2018-09-27 Thread Coly Li
org Signed-off-by: Coly Li --- drivers/md/bcache/bcache.h | 1 + drivers/md/bcache/journal.c | 6 +++--- drivers/md/bcache/super.c | 8 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index 83504dd8100a..954dad29e

Re: [PATCH] bcache: fix ioctl in flash device

2018-09-30 Thread Coly Li
ave it in my for-next. Thanks. Coly Li --- drivers/md/bcache/request.c | 3 +++ drivers/md/bcache/super.c | 4 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 7dbe8b6..bafc85e 100644 --- a/drivers/md/bca

Re: [PATCH] bcache: correct dirty data statistics

2018-09-30 Thread Coly Li
replay, so we need to count these dirty keys even device in clean status, otherwise after writeback, the amount of dirty data would be incorrect. Signed-off-by: Tang Junhui --- Nice catch. Added to my for-next, and CC sta...@vger.kernel.org. Thanks. Coly Li drivers/md/bcache/super.c | 3

[PATCH 02/15] bcache: trace missed reading by cache_missed

2018-10-08 Thread Coly Li
From: Tang Junhui Missed reading IOs are identified by s->cache_missed, not the s->cache_miss, so in trace_bcache_read() using trace_bcache_read to identify whether the IO is missed or not. Signed-off-by: Tang Junhui Cc: sta...@vger.kernel.org Signed-off-by: Coly Li --- drivers/md/

[PATCH 03/15] bcache: use REQ_PRIO to indicate bio for metadata

2018-10-08 Thread Coly Li
file system code. This patch replaces REQ_META with correct flag REQ_PRIO. CC Adam Manzanares because he explains to me what REQ_PRIO is for. Signed-off-by: Coly Li Cc: Adam Manzanares --- drivers/md/bcache/request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 01/15] bcache: account size of buckets used in uuid write to ca->meta_sectors_written

2018-10-08 Thread Coly Li
e change. After the change, the value is bigger about 1 bucket size. Signed-off-by: Shenghui Wang Reviewed-by: Tang Junhui Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super

[PATCH 05/15] bcache: fix typo in code comments of closure_return_with_destructor()

2018-10-08 Thread Coly Li
The code comments of closure_return_with_destructor() in closure.h makrs function name as closure_return(). This patch fixes this type with the correct name - closure_return_with_destructor. Signed-off-by: Coly Li --- drivers/md/bcache/closure.h | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 04/15] bcache: fix ioctl in flash device

2018-10-08 Thread Coly Li
xes: 0f0709e6bfc3c ("bcache: stop bcache device when backing device is offline") Signed-off-by: Tang Junhui Cc: sta...@vger.kernel.org Signed-off-by: Coly Li --- drivers/md/bcache/request.c | 3 +++ drivers/md/bcache/super.c | 4 2 files changed, 3 insertions(+), 4 deletions(-)

[PATCH 00/15] bcache patches for 4.20

2018-10-08 Thread Coly Li
c for too small cache set size, with other code cleanup changes. Shenghui and me have several code cleanup and minor fixes, and Junhui again contributes helpful fixes for several real bugs. Please pull them for 4.20 merge window. Thanks in advance. Coly Li --- Ben Peddell (1): bcache: Pop

[PATCH 06/15] bcache: correct dirty data statistics

2018-10-08 Thread Coly Li
-off-by: Coly Li --- drivers/md/bcache/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index a99af19d2f91..4989c7d4d4d0 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1152,11 +1152,12

[PATCH 07/15] bcache: Populate writeback_rate_minimum attribute

2018-10-08 Thread Coly Li
ck_rate_minimum attribute was dropped. Re-add the missing sysfs writeback_rate_minimum attribute mapping to "allow the user to specify a minimum rate at which dirty blocks are retired." Fixes: 1d316e6 bcache: implement PI controller for writeback rate Signed-off-by: Ben Peddell Signed-off-

[PATCH 09/15] bcache: recal cached_dev_sectors on detach

2018-10-08 Thread Coly Li
From: Shenghui Wang Recal cached_dev_sectors on cached_dev detached, as recal done on cached_dev attached. Update the cached_dev_sectors before bcache_device_detach called as bcache_device_detach will set bcache_device->c to NULL. Signed-off-by: Shenghui Wang Signed-off-by: Coly

[PATCH 11/15] bcache: remove useless parameter of bch_debug_init()

2018-10-08 Thread Coly Li
From: Dongbo Cao Parameter "struct kobject *kobj" in bch_debug_init() is useless, remove it in this patch. Signed-off-by: Dongbo Cao Signed-off-by: Coly Li --- drivers/md/bcache/bcache.h | 2 +- drivers/md/bcache/debug.c | 2 +- drivers/md/bcache/super.c | 2 +- 3 files

[PATCH 10/15] bcache: remove unused bch_passthrough_cache

2018-10-08 Thread Coly Li
From: Shenghui Wang struct kmem_cache *bch_passthrough_cache is not used in bcache code. Remove it. Signed-off-by: Shenghui Wang Signed-off-by: Coly Li --- drivers/md/bcache/request.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/request.h b/drivers/md

[PATCH 08/15] bcache: fix miss key refill->end in writeback

2018-10-08 Thread Coly Li
ey buffer. Signed-off-by: Tang Junhui Cc: sta...@vger.kernel.org Signed-off-by: Coly Li --- drivers/md/bcache/btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index e7d4817681f2..3f4211b5cd33 100644 --- a/drivers/md/bcach

[PATCH 12/15] bcache: replace hard coded number with BUCKET_GC_GEN_MAX

2018-10-08 Thread Coly Li
In extents.c:bch_extent_bad(), number 96 is used as parameter to call btree_bug_on(). The purpose is to check whether stale gen value exceeds BUCKET_GC_GEN_MAX, so it is better to use macro BUCKET_GC_GEN_MAX to make the code more understandable. Signed-off-by: Coly Li --- drivers/md/bcache

[PATCH 13/15] bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set

2018-10-08 Thread Coly Li
ned-off-by: Shenghui Wang Signed-off-by: Coly Li --- 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 7a28232d868b..5002838ea476 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c

[PATCH 14/15] bcache: split combined if-condition code into separate ones

2018-10-08 Thread Coly Li
From: Dongbo Cao Split the combined '||' statements in if() check, to make the code easier for debug. Signed-off-by: Dongbo Cao Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 90 +-- 1 file changed, 76 insertions(+), 14 deletions(-) di

[PATCH 15/15] bcache: panic fix for making cache device

2018-10-08 Thread Coly Li
From: Dongbo Cao when the nbuckets of cache device is smaller than 1024, making cache device will trigger BUG_ON in kernel, add a condition to avoid this. Reported-by: nitroxis Signed-off-by: Dongbo Cao Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 8 1 file changed, 8

Re: [PATCH 07/15] bcache: Populate writeback_rate_minimum attribute

2018-10-08 Thread Coly Li
On 2018/10/8 下午10:19, Jens Axboe wrote: > On 10/8/18 6:41 AM, Coly Li wrote: >> From: Ben Peddell >> >> Forgot to include the maintainers with my first email. >> >> Somewhere between Michael Lyle's original >> "bcache: PI controller for writebac

[PATCH 2/5] bcache: option to automatically run gc thread after writeback accomplished

2018-11-22 Thread Coly Li
, which may be helpful for future writing requests. If you are not sure whether this is helpful for your own workload, please leave it as disabled by default. Signed-off-by: Coly Li --- drivers/md/bcache/bcache.h| 14 ++ drivers/md/bcache/sysfs.c | 9 + drivers/md

[PATCH 1/5] bcache: introduce force_wake_up_gc()

2018-11-22 Thread Coly Li
sets c->sectors_to_gc to a positive value before gc_should_run(). This routine can be called where the gc thread is woken up and required to run in force. Signed-off-by: Coly Li --- drivers/md/bcache/btree.h | 18 ++ drivers/md/bcache/sysfs.c | 17 ++--- 2 files ch

[PATCH 0/5] Writeback performance tuning options

2018-11-22 Thread Coly Li
: set writeback_percent in a flexible range If anyone is also interested on writeback performance tuning with these tunnable options, I do appreciate if you find a better performance number with the non-default option values, and share them with us. Thanks in advance. Coly Li --- Coly Li (5): bcache: intr

[PATCH 3/5] bcache: add MODULE_DESCRIPTION information

2018-11-22 Thread Coly Li
This patch moves MODULE_AUTHOR and MODULE_LICENSE to end of super.c, and add MODULE_DESCRIPTION("Bcache: a Linux block layer cache"). This is preparation for adding module parameters. Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH 4/5] bcache: make cutoff_writeback and cutoff_writeback_sync tunnable

2018-11-22 Thread Coly Li
of users for most of workloads. Anyway, if people wants to take their own risk to do research on new writeback cutoff tuning for their own workload, now they can make it. Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 40 drivers/md/bcache/sysf

[PATCH 5/5] bcache: set writeback_percent in a flexible range

2018-11-22 Thread Coly Li
workloads. But for people who want to do research on bcache writeback perforamnce tuning, they may have chance to specify more flexible writeback_percent in range [0, 70]. Signed-off-by: Coly Li --- drivers/md/bcache/sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH] bcache: never writeback a discard operation

2019-01-22 Thread Coly Li
t; (first use in this function); did you mean ‘REQ_DISCARD’? >> >> >> How should we proceed with this patch? > > The patch seems reasonably easy to backport. Compile-tested only, and > only against v4.4.171. I don't have idea whether stable kernels accept rebased patches, for SUSE kernel I will do back port for all necessary kernel versions. -- Coly Li

Re: [PATCH] bcache: fix a race between register and allocator thread

2019-02-06 Thread Coly Li
o_wait(&c->bucket_wait, &wait, > + TASK_UNINTERRUPTIBLE); > + if (!fifo_empty(&ca->free_inc)) > + break; > + mutex_unlock(&c->bucket_lock); > + schedule(); > + mutex_lock(&c->bucket_lock); > + } > + > + finish_wait(&c->bucket_wait, &wait); > bch_prio_write(ca); > + } > mutex_unlock(&c->bucket_lock); > > err = "cannot allocate new UUID bucket"; > Hi Junhui, It seems your patch losts all indent format. Could you please to handle it and resend the peroper format again ? Thanks. -- Coly Li

[PATCH v2] bcache: use (REQ_META|REQ_PRIO) to indicate bio for metadata

2019-02-07 Thread Coly Li
th metadata and high priority I/O requests will be handled properly. Reported-by: Nix Signed-off-by: Coly Li Reviewed-by: Andre Noll Cc: sta...@vger.kernel.org Cc: Dave Chinner Cc: Christoph Hellwig --- drivers/md/bcache/request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) dif

[PATCH 02/19] bcache: not use hard coded memset size in bch_cache_accounting_clear()

2019-02-08 Thread Coly Li
h replaces 'sizeof(unsigned long) * 7' by more generic 'sizeof(struct cache_stats))', to avoid potential error if new member added into struct cache_stats. Signed-off-by: Coly Li --- drivers/md/bcache/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH 00/19] bcache patches for Linux v5.1

2019-02-08 Thread Coly Li
metadata issue for XFS. Please take them in your for-next. Thanks in advance. Coly Li --- Colin Ian King (1): bcache: fix indentation issue, remove tabs on a hunk of code Coly Li (16): bcache: not use hard coded memset size in bch_cache_accounting_clear() bcache: export backing_dev_name via

[PATCH 01/19] bcache: never writeback a discard operation

2019-02-08 Thread Coly Li
of debugging: https://www.spinics.net/lists/linux-bcache/msg06996.html Previous reports: - https://bugzilla.kernel.org/show_bug.cgi?id=201051 - https://bugzilla.kernel.org/show_bug.cgi?id=196103 - https://www.spinics.net/lists/linux-bcache/msg06885.html (Coly Li: minor modification to follow maxi

[PATCH 03/19] bcache: export backing_dev_name via sysfs

2019-02-08 Thread Coly Li
een bcache device and backing device. Signed-off-by: Coly Li --- drivers/md/bcache/sysfs.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 557a8a3270a1..b9166ee027fa 100644 --- a/drivers/md/bcache/sysfs.c +++ b/drivers/md/bca

[PATCH 04/19] bcache: export backing_dev_uuid via sysfs

2019-02-08 Thread Coly Li
-show, but directly exporting backing_dev_uuid by sysfs file /sys/block/bcache/bcache/backing_dev_uuid is a much simpler method. With backing_dev_uuid, and partition uuids from /dev/disk/by-partuuid/, now we can identify each bcache device and its partitions conveniently. Signed-off-by: Coly Li

[PATCH 05/19] bcache: fix indentation issue, remove tabs on a hunk of code

2019-02-08 Thread Coly Li
From: Colin Ian King There is a hunk of code that is indented one level too deep, fix this by removing the extra tabs. Signed-off-by: Colin Ian King Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions

[PATCH 08/19] bcache: fix input integer overflow of congested threshold

2019-02-08 Thread Coly Li
lue indeed set is 1410065407, which is not expected behavior. This patch replaces sysfs_strtoul() by sysfs_strtoul_clamp() when convert input string to unsigned int value, and set value range in [0, UINT_MAX], to avoid the above integer overflow errors. Signed-off-by: Coly Li --- drivers/md/bcac

[PATCH 06/19] bcache: treat stale && dirty keys as bad keys

2019-02-08 Thread Coly Li
dc->disk.c, &w->key, 0)); B) It could be worse when reads hits stale dirty keys, it would read old incorrect data. This patch tolerate the existence of these stale && dirty keys, and treat them as bad key in bch_extent_bad(). (Coly Li: fix indent which was modified by sender

[PATCH 11/19] bcache: use sysfs_strtoul_bool() to set bit-field variables

2019-02-08 Thread Coly Li
etting a bool value like expensive_debug_checks. Signed-off-by: Coly Li --- drivers/md/bcache/sysfs.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 96b64893f2cb..57395e23747a 100644 --- a/drivers/md/bcache/sysfs.c

[PATCH 07/19] bcache: improve sysfs_strtoul_clamp()

2019-02-08 Thread Coly Li
this method, if bit width of var is less than unsigned long, integer overflow won't happen before min and max are checking. Now sysfs_strtoul_clamp() can properly handle smaller data type like unsigned int, of cause min and max should be defined in range of unsigned int too. Signed-off-by

[PATCH 12/19] bcache: fix input overflow to writeback_delay

2019-02-08 Thread Coly Li
dc->writeback_delay. This patch uses sysfs_strtoul_clamp() to convert the input string and set the result value range in [0, UINT_MAX] to avoid such unsigned integer overflow. Signed-off-by: Coly Li --- drivers/md/bcache/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

<    1   2   3   4   5   6   7   8   9   >