From ed602ac2eaf775c86aa7d73e334359e6a5e955ca Mon Sep 17 00:00:00 2001 From: skanta Date: Tue, 5 Nov 2024 16:18:32 +0530 Subject: [PATCH] Revert "blk/KernelDevice: React to bdev_enable_discard changes in handle_conf_change()" This reverts commit d58c5c861ab80583b6878e5bce759d64b1991561. The commit was merged prematurely without testing. Signed-off-by: Srinivasa Bharath Kanta --- src/blk/kernel/KernelDevice.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/blk/kernel/KernelDevice.cc b/src/blk/kernel/KernelDevice.cc index 3e9e0a6b7a767..b990f7d15372f 100644 --- a/src/blk/kernel/KernelDevice.cc +++ b/src/blk/kernel/KernelDevice.cc @@ -1515,7 +1515,6 @@ const char** KernelDevice::get_tracked_conf_keys() const { static const char* KEYS[] = { "bdev_async_discard_threads", - "bdev_enable_discard", NULL }; return KEYS; @@ -1524,16 +1523,11 @@ const char** KernelDevice::get_tracked_conf_keys() const void KernelDevice::handle_conf_change(const ConfigProxy& conf, const std::set &changed) { - if (changed.count("bdev_async_discard_threads") || changed.count("bdev_enable_discard")) { + if (changed.count("bdev_async_discard_threads")) { std::unique_lock l(discard_lock); uint64_t oldval = target_discard_threads; uint64_t newval = cct->_conf.get_val("bdev_async_discard_threads"); - if (!cct->_conf.get_val("bdev_enable_discard")) { - // We don't want these threads running if discard has been disabled (this is consistent with - // KernelDevice::open()) - newval = 0; - } target_discard_threads = newval; @@ -1547,8 +1541,8 @@ void KernelDevice::handle_conf_change(const ConfigProxy& conf, discard_threads.emplace_back(new DiscardThread(this, i)); discard_threads.back()->create("bstore_discard"); } - // Decrease? Signal threads after telling them to stop - } else if (newval < oldval) { + } else { + // Decrease? Signal threads after telling them to stop dout(10) << __func__ << " stopping " << (oldval - newval) << " existing discard threads" << dendl; // Decreasing to zero is exactly the same as disabling async discard. -- 2.39.5