Message ID | 20201001065056.24411-2-colyli@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | bcache patches for Linux v5.10 | expand |
On 10/1/20 12:50 AM, Coly Li wrote: > Previously the experimental async registration uses a separate sysfs > file register_async. Now the async registration code seems working well > for a while, we can do furtuher testing with it now. > > This patch changes the async bcache registration shares the same sysfs > file /sys/fs/bcache/register (and register_quiet). Async registration > will be default behavior if BCACHE_ASYNC_REGISTRATION is set in kernel > configure. By default, BCACHE_ASYNC_REGISTRATION is not configured yet. Will this potentially break existing use cases?
On 2020/10/2 05:19, Jens Axboe wrote: > On 10/1/20 12:50 AM, Coly Li wrote: >> Previously the experimental async registration uses a separate sysfs >> file register_async. Now the async registration code seems working well >> for a while, we can do furtuher testing with it now. >> >> This patch changes the async bcache registration shares the same sysfs >> file /sys/fs/bcache/register (and register_quiet). Async registration >> will be default behavior if BCACHE_ASYNC_REGISTRATION is set in kernel >> configure. By default, BCACHE_ASYNC_REGISTRATION is not configured yet. > > Will this potentially break existing use cases? > Hi Jens, This experimental config is disabled by default, so people will still use existing synchronized registration unless they explicit enable the Kconfig item. I use the async registration in my development and testing, it works fine and the advantage is no-boot-time-out any more. There are still a few boot-up configurations I need to confirm, so the async interface will keep being experimental for a while. Thanks. Coly Li
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 1bbdc410ee3c..61abd6499a11 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2449,7 +2449,6 @@ static ssize_t bch_pending_bdevs_cleanup(struct kobject *k, kobj_attribute_write(register, register_bcache); kobj_attribute_write(register_quiet, register_bcache); -kobj_attribute_write(register_async, register_bcache); kobj_attribute_write(pendings_cleanup, bch_pending_bdevs_cleanup); static bool bch_is_open_backing(struct block_device *bdev) @@ -2572,6 +2571,11 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, struct cache_sb_disk *sb_disk; struct block_device *bdev; ssize_t ret; + bool async_registration = false; + +#ifdef CONFIG_BCACHE_ASYNC_REGISTRATION + async_registration = true; +#endif ret = -EBUSY; err = "failed to reference bcache module"; @@ -2625,7 +2629,8 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, goto out_blkdev_put; err = "failed to register device"; - if (attr == &ksysfs_register_async) { + + if (async_registration) { /* register in asynchronous way */ struct async_reg_args *args = kzalloc(sizeof(struct async_reg_args), GFP_KERNEL); @@ -2888,9 +2893,6 @@ static int __init bcache_init(void) static const struct attribute *files[] = { &ksysfs_register.attr, &ksysfs_register_quiet.attr, -#ifdef CONFIG_BCACHE_ASYNC_REGISTRATION - &ksysfs_register_async.attr, -#endif &ksysfs_pendings_cleanup.attr, NULL };
Previously the experimental async registration uses a separate sysfs file register_async. Now the async registration code seems working well for a while, we can do furtuher testing with it now. This patch changes the async bcache registration shares the same sysfs file /sys/fs/bcache/register (and register_quiet). Async registration will be default behavior if BCACHE_ASYNC_REGISTRATION is set in kernel configure. By default, BCACHE_ASYNC_REGISTRATION is not configured yet. Signed-off-by: Coly Li <colyli@suse.de> --- drivers/md/bcache/super.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)