File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -604,6 +604,7 @@ void KernelDevice::discard_drain()
604604 dout (10 ) << __func__ << dendl;
605605 std::unique_lock l (discard_lock);
606606 while (!discard_queued.empty () || (discard_running > 0 )) {
607+ need_notify = true ;
607608 discard_cond.wait (l);
608609 }
609610}
@@ -769,7 +770,10 @@ void KernelDevice::_discard_thread(uint64_t tid)
769770 if (thr->stop )
770771 break ;
771772 dout (20 ) << __func__ << " sleep" << dendl;
772- discard_cond.notify_all (); // for the thread trying to drain...
773+ if (need_notify) {
774+ discard_cond.notify_all (); // for the thread trying to drain...
775+ need_notify = false ;
776+ }
773777 discard_cond.wait (l);
774778 dout (20 ) << __func__ << " wake" << dendl;
775779 } else {
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ class KernelDevice : public BlockDevice,
5858 aio_callback_t discard_callback;
5959 void *discard_callback_priv;
6060 bool aio_stop;
61+ bool need_notify = false ;
6162 std::unique_ptr<PerfCounters> logger;
6263
6364 ceph::mutex discard_lock = ceph::make_mutex(" KernelDevice::discard_lock" );
You can’t perform that action at this time.
0 commit comments