From patchwork Mon Jan 8 19:51:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 10150457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F135A601BE for ; Mon, 8 Jan 2018 19:51:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 067D92890F for ; Mon, 8 Jan 2018 19:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EED0B28918; Mon, 8 Jan 2018 19:51:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D1112890F for ; Mon, 8 Jan 2018 19:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933639AbeAHTvH (ORCPT ); Mon, 8 Jan 2018 14:51:07 -0500 Received: from mail-io0-f176.google.com ([209.85.223.176]:36317 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932750AbeAHTvG (ORCPT ); Mon, 8 Jan 2018 14:51:06 -0500 Received: by mail-io0-f176.google.com with SMTP id i143so15913112ioa.3; Mon, 08 Jan 2018 11:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nOyexXuVQNFZiSkJU17M4qJF34tpMo0fpky8Lh/Yk2w=; b=twfyFLICnBK2Te1ouLTNgIud+T55jC+OtVwcDXl2v1J0hxvMwljZeBLxfR5ohn7A+o g39yIAAB50dHUOkB1KdCCkioRlYzBskJU1Ih0XvoSOCNWdGr7Dggi+/vdhcKiRW3B2dF l6S7xrRSWL3RpdwyOz+oIbvBnziEol9HZwngU8MC5KvC6RIW60qlXNuhDaqe7fL8cbaE yBUckSy5TsE4Dg6RlJQrAtXuCcI2asG1ZPSU4T6SnFoO5UTkNBfR8dof6vghIJSq3YFX Pm0Nmb2uINLSThKjXOyb9EdfEpg0Tx9AJURM303wKu0mgeLxHs1y/LWiOfo0Mm2SfiIh aVHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nOyexXuVQNFZiSkJU17M4qJF34tpMo0fpky8Lh/Yk2w=; b=Wy9doOExeY2MaDusc8QUi4KqDrbUFaXGDC2qLfE2ZEa2ZBvuE0CEGtH2MNyWt2UCER hWFOda7YeRNx82XC3pbmVpNiUWDdUbIW/zF4c8R5AA9HIG1LBnrZYfyHcLEWOJR0aRyp rx/cC4vlwmnWPnGPqNk7pZnSK3nnDNyFuvq8/u7dDnzHX+ZM+xx/g9/bNeUvJEdsNqLx w8OXjo/J2nY6wr9bVINZWB6ppJGdSYNEssxXwKhJOX34F+kGZkOlpVEPOyQ0kmcmaaiZ zafi7ri+EJmqCNIgKZ54Hlwcqw6Rir3KCLukyoK9ymMbydNOCJowsitoNTYzV9BsFuWt 0dCQ== X-Gm-Message-State: AKGB3mLBs/FmRKAu9XfoCEK6MN/FHasuG5RGmq5QbAoEdHboz0t5ik8b 2dvMPe6hSaqHKePJT9qhrkFuMcvfFzAcyaBQvgA= X-Google-Smtp-Source: ACJfBovH/wul7MlCsffK2g9+c/h7mHInLB5AQHVRJ47h5qo/GY+YnKxXWSrAeC417/Aaz2TO/CO9cG0XMPqdyrTryzs= X-Received: by 10.107.53.215 with SMTP id k84mr12424501ioo.46.1515441065107; Mon, 08 Jan 2018 11:51:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.20.11 with HTTP; Mon, 8 Jan 2018 11:51:04 -0800 (PST) In-Reply-To: References: From: Linus Torvalds Date: Mon, 8 Jan 2018 11:51:04 -0800 X-Google-Sender-Auth: KCdgBbMjodZimm95ZU76kZgVw54 Message-ID: Subject: Re: dvb usb issues since kernel 4.9 To: Alan Stern Cc: Ingo Molnar , Mauro Carvalho Chehab , Josef Griebichler , Greg Kroah-Hartman , USB list , Eric Dumazet , Rik van Riel , Paolo Abeni , Hannes Frederic Sowa , Jesper Dangaard Brouer , linux-kernel , netdev , Jonathan Corbet , LMML , Peter Zijlstra , David Miller Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jan 8, 2018 at 11:15 AM, Alan Stern wrote: > > Both dwc2_hsotg and ehci-hcd use the tasklets embedded in the > giveback_urb_bh member of struct usb_hcd. See usb_hcd_giveback_urb() > in drivers/usb/core/hcd.c; the calls are > > else if (high_prio_bh) > tasklet_hi_schedule(&bh->bh); > else > tasklet_schedule(&bh->bh); > > As it turns out, high_prio_bh gets set for interrupt and isochronous > URBs but not for bulk and control URBs. The DVB driver in question > uses bulk transfers. Ok, so we could try out something like the appended? NOTE! I have not tested this at all. It LooksObvious(tm), but... Linus kernel/softirq.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 2f5e87f1bae2..97b080956fea 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -79,12 +79,16 @@ static void wakeup_softirqd(void) /* * If ksoftirqd is scheduled, we do not want to process pending softirqs - * right now. Let ksoftirqd handle this at its own rate, to get fairness. + * right now. Let ksoftirqd handle this at its own rate, to get fairness, + * unless we're doing some of the synchronous softirqs. */ -static bool ksoftirqd_running(void) +#define SOFTIRQ_NOW_MASK ((1 << HI_SOFTIRQ) | (1 << TASKLET_SOFTIRQ)) +static bool ksoftirqd_running(unsigned long pending) { struct task_struct *tsk = __this_cpu_read(ksoftirqd); + if (pending & SOFTIRQ_NOW_MASK) + return false; return tsk && (tsk->state == TASK_RUNNING); } @@ -325,7 +329,7 @@ asmlinkage __visible void do_softirq(void) pending = local_softirq_pending(); - if (pending && !ksoftirqd_running()) + if (pending && !ksoftirqd_running(pending)) do_softirq_own_stack(); local_irq_restore(flags); @@ -352,7 +356,7 @@ void irq_enter(void) static inline void invoke_softirq(void) { - if (ksoftirqd_running()) + if (ksoftirqd_running(local_softirq_pending())) return; if (!force_irqthreads) {