Skip to contentSkip to conversation

Quick SSD detach

DISCUSSION Yongseok Oh 1 participant 1 message Feb 3, 2015 bcache (block layer cache)

lore
Share & tools
lore
#0 lore raw

Hi all,

I have seen that detaching an SSD from bcache
requires several minutes (e.g., 30 min..).
So I have tried to modify bch_cached_dev_detach() code to remove a cache device quickly.
Unfortunately, kernel panic has been occurred by my modification.

Is there no option to detach an SSD rapidly?
I always tried to reboot my system when the
performance measurement is just finished.

Thanks.

907 void bch_cached_dev_detach(struct cached_dev *dc) 908 {
909 lockdep_assert_held(&bch_register_lock);
910
911 if (atomic_read(&dc->disk.closing))
912 return;
913
914 if (atomic_xchg(&dc->disk.detaching, 1))
915 return;
916
923 closure_get(&dc->disk.cl);
924
927 bch_writeback_queue(dc);
928
929 atomic_set(&dc->force_detach, 1);
930 dc->writeback_running = 0;
931

 932     atomic_set(&dc->has_dirty, 0);
 933     atomic_set(&dc->running, 0);
 934     schedule_work(&dc->detach);

942 }