Skip to content

Commit 9eca804

Browse files
committed
Revert "blk-mq, percpu_ref: implement a kludge for SCSI blk-mq stall during probe"
This reverts commit 0a30288, which was a temporary fix for SCSI blk-mq stall issue. The following patches will fix the issue properly by introducing atomic mode to percpu_ref. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Kent Overstreet <kmo@daterainc.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Christoph Hellwig <hch@lst.de>
1 parent d06efeb commit 9eca804

3 files changed

Lines changed: 1 addition & 27 deletions

File tree

‎block/blk-mq.c‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,7 @@ void blk_mq_freeze_queue(struct request_queue *q)
119119
spin_unlock_irq(q->queue_lock);
120120

121121
if (freeze) {
122-
/*
123-
* XXX: Temporary kludge to work around SCSI blk-mq stall.
124-
* SCSI synchronously creates and destroys many queues
125-
* back-to-back during probe leading to lengthy stalls.
126-
* This will be fixed by keeping ->mq_usage_counter in
127-
* atomic mode until genhd registration, but, for now,
128-
* let's work around using expedited synchronization.
129-
*/
130-
__percpu_ref_kill_expedited(&q->mq_usage_counter);
131-
122+
percpu_ref_kill(&q->mq_usage_counter);
132123
blk_mq_run_queues(q, false);
133124
}
134125
wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->mq_usage_counter));

‎include/linux/percpu-refcount.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ void percpu_ref_reinit(struct percpu_ref *ref);
7272
void percpu_ref_exit(struct percpu_ref *ref);
7373
void percpu_ref_kill_and_confirm(struct percpu_ref *ref,
7474
percpu_ref_func_t *confirm_kill);
75-
void __percpu_ref_kill_expedited(struct percpu_ref *ref);
7675

7776
/**
7877
* percpu_ref_kill - drop the initial ref

‎lib/percpu-refcount.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,3 @@ void percpu_ref_kill_and_confirm(struct percpu_ref *ref,
189189
call_rcu_sched(&ref->rcu, percpu_ref_kill_rcu);
190190
}
191191
EXPORT_SYMBOL_GPL(percpu_ref_kill_and_confirm);
192-
193-
/*
194-
* XXX: Temporary kludge to work around SCSI blk-mq stall. Used only by
195-
* block/blk-mq.c::blk_mq_freeze_queue(). Will be removed during v3.18
196-
* devel cycle. Do not use anywhere else.
197-
*/
198-
void __percpu_ref_kill_expedited(struct percpu_ref *ref)
199-
{
200-
WARN_ONCE(ref->pcpu_count_ptr & PCPU_REF_DEAD,
201-
"percpu_ref_kill() called more than once on %pf!",
202-
ref->release);
203-
204-
ref->pcpu_count_ptr |= PCPU_REF_DEAD;
205-
synchronize_sched_expedited();
206-
percpu_ref_kill_rcu(&ref->rcu);
207-
}

0 commit comments

Comments
 (0)