From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517AbeCNPXx (ORCPT ); Wed, 14 Mar 2018 11:23:53 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51546 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbeCNPXw (ORCPT ); Wed, 14 Mar 2018 11:23:52 -0400 Date: Wed, 14 Mar 2018 16:23:46 +0100 From: Sebastian Andrzej Siewior To: Peter Zijlstra Cc: linux-rt-users , Corey Minyard , Thomas Gleixner , Steven Rostedt , linux-kernel , Tejun Heo Subject: Re: [RT PATCH 2/2] block: blk-mq: move blk_queue_usage_counter_release() into process context Message-ID: <20180314152345.xyphm4dg4m7suqov@linutronix.de> References: <20180309202550.j66qphz3txupt55u@linutronix.de> <20180309222643.GC5926@hirez.programming.kicks-ass.net> <20180312105113.p7jifhwdwbhpvxds@linutronix.de> <20180312132729.GI4064@hirez.programming.kicks-ass.net> <20180312141107.roveviectc6a75s7@linutronix.de> <20180312142933.GF4043@hirez.programming.kicks-ass.net> <20180312195118.rye5lg2pb26kmavn@linutronix.de> <20180313184039.begptzircgb5ketk@linutronix.de> <20180313184240.ndq2pw2fmvhkwidc@linutronix.de> <20180313201039.GB4082@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180313201039.GB4082@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-03-13 21:10:39 [+0100], Peter Zijlstra wrote: > On Tue, Mar 13, 2018 at 07:42:41PM +0100, Sebastian Andrzej Siewior wrote: > > +static void blk_queue_usage_counter_release_swork(struct swork_event *sev) > > +{ > > + struct request_queue *q = > > + container_of(sev, struct request_queue, mq_pcpu_wake); > > + > > + wake_up_all(&q->mq_freeze_wq); > > +} > > + > > static void blk_queue_usage_counter_release(struct percpu_ref *ref) > > { > > struct request_queue *q = > > container_of(ref, struct request_queue, q_usage_counter); > > > > - wake_up_all(&q->mq_freeze_wq); > > + swork_queue(&q->mq_pcpu_wake); > > } > > Depending on if we expect there to actually be wakeups, you could do > something like: > > if (wq_has_sleepers(&q->mq_freeze_wq)) > swork_queue(&q->mq_pcpu_wake)); > > avoiding the whole workqueue thing in the case there wasn't anybody > waiting for it. But since I don't know this code, I can't say if it > makes sense or not. Tejun? this pops up on boot and shows that there are no waiter. So I consider to take this. Sebastian