[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rt-users
Subject:    Re: [ANNOUNCE] v5.10-rc1-rt1
From:       Mike Galbraith <efault () gmx ! de>
Date:       2020-10-29 4:37:44
Message-ID: 0945ac2959a7ef04f5b3eeaa28b71261c7ccfeb2.camel () gmx ! de
[Download RAW message or body]

"blk-mq: Use llist_head for blk_cpu_done" needs a minor adjustment, as
is it induces much grumbling...

BUG: using smp_processor_id() in preemptible [00000000] code: usb-storage/479

@@ -657,6 +621,7 @@ static inline bool blk_mq_complete_need_

 bool blk_mq_complete_request_remote(struct request *rq)
 {
+	struct llist_head *cpu_list;
 	WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);

 	/*
@@ -667,14 +632,21 @@ bool blk_mq_complete_request_remote(stru
 		return false;

 	if (blk_mq_complete_need_ipi(rq)) {
-		rq->csd.func = __blk_mq_complete_request_remote;
-		rq->csd.info = rq;
-		rq->csd.flags = 0;
-		smp_call_function_single_async(rq->mq_ctx->cpu, &rq->csd);
+		unsigned int cpu;
+
+		cpu = rq->mq_ctx->cpu;
+		cpu_list = &per_cpu(blk_cpu_done, cpu);
+		if (llist_add(&rq->ipi_list, cpu_list)) {
+			rq->csd.func = __blk_mq_complete_request_remote;
+			rq->csd.flags = 0;
+			smp_call_function_single_async(cpu, &rq->csd);
+		}
 	} else {
 		if (rq->q->nr_hw_queues > 1)
 			return false;
-		blk_mq_trigger_softirq(rq);
+		cpu_list = this_cpu_ptr(&blk_cpu_done);  <== there
+		if (llist_add(&rq->ipi_list, cpu_list))
+			raise_softirq(BLOCK_SOFTIRQ);
 	}

 	return true;



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic