Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1212739imm; Wed, 13 Jun 2018 15:32:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIAK+Y1FVTN8XNCcw1Svt39X6puJWPvwvvmL+Xd/nWLqCXAwMcKApHSar/E7WqPHyD9VB5v X-Received: by 2002:a63:5f8b:: with SMTP id t133-v6mr69147pgb.68.1528929148497; Wed, 13 Jun 2018 15:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528929148; cv=none; d=google.com; s=arc-20160816; b=JgEBuWY/wHay5O3mn65PR7wfunoqWH+LiKR4D0oTS4Ny2+iiXS1knUPplJ98/vSqI8 6fzKPgt2obBCr18R3X0GpAq8IfwLnUavieJHBLNfa8HbIgBYB06859b71iIZ3JNnl+8d a+H5Nv0RZq8pnSFojBrwxspOdvltIJZvvd3/O6LnEwhTAN+af95WnHcyV5mzbXMwmnLp 6vdzm73ou0p7UoHPSjTxkofQ3AyF3gA5mjn7iwztPm+RwPMqx/6UMuwgi4UdXsNm+wfL UVLWeCs0SAhFSssRGfoI5ISHkPCg/tsWLA9HHiy7N0FhvUlFDujkjC2oo0x2LEUpYpPt VhQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=hdS9+6U/8zxPjFYoqwaIiV1kgpBm9aI3tJ7AXhfX8TU=; b=qpMmdRXALICtWve0hcXeNkW0TYeef/ogwGcYWlraejl0eS81z2FxrVy16cpDe+GVpf XbDDMMxEDGqSK5IYJt5v8SpKHzM7MSuQz7Z5EUBBgpQk5Nl3X7GmO4HPHUkehEhuO0Zc cxDMI9Hh1Sp3FcxeHTiX5hSsiSNmBaQ2Ly85LsadRQdq8OKRFLFFNvrcm1Bn7d7W1aTf VqA8JeaZ0efYBlxPOs9jF1lGjudCY5c96KI3nBdxwKb8hXZZhx3TySX+wtSt5J+VMxER eIpK4QKo7WpehaVu8vJjSqiZzxxNM3ucCYomKRKn6zR8pa1l2CHse3kYO7yLxiYWfRLc ypaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a62-v6si3140699pge.492.2018.06.13.15.32.14; Wed, 13 Jun 2018 15:32:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935833AbeFMWbt (ORCPT + 99 others); Wed, 13 Jun 2018 18:31:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:45742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935256AbeFMWbs (ORCPT ); Wed, 13 Jun 2018 18:31:48 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F4562087E; Wed, 13 Jun 2018 22:31:47 +0000 (UTC) Date: Wed, 13 Jun 2018 18:31:45 -0400 From: Steven Rostedt To: Mikulas Patocka Cc: Alan Stern , Thomas Gleixner , Ming Lei , Greg Kroah-Hartman , USB list , Kernel development list Subject: Re: [PATCH] usb: don't offload isochronous urb completions to ksoftirq Message-ID: <20180613183145.17564d82@gandalf.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jun 2018 15:30:31 -0400 (EDT) Mikulas Patocka wrote: > On Wed, 13 Jun 2018, Alan Stern wrote: > > > [Steve: Sorry for dumping you into the middle of this discussion. > > Please see especially the last two paragraphs below. Mikulas is > > getting dropouts with USB audio because part of the processing uses a > > tasklet.] > > The problem is this: > > I have a single core machine with a usb2 sound card. When I increase the > priority of a music player, the audio starts skipping. > > The reason for the skipping is that the ehci usb driver is offloading urb > callbacks using tasklet_hi_schedule, the callbacks end up being offloaded > to the ksoftirqd thread (that has priority 0), the music player with > elevated priority preempts ksoftirqd and causes delays in the urb > callbacks. > > Is this some deficiency in the softirq subsystem? (should we perhaps treat > tasklet_hi specially and not offload it as much as the others?) Or should > the ehci driver be fixed not to use tasklets? > What we do for softirqs in the RT patch is to have whoever raised the softirq run the softirq. If local_bh_disabled() is active (bh is disabled) then a bit is set in the current task struct, where when local_bh_enable() is called, it will then execute the softirqs that it raised while bh was disabled. Perhaps try out the PREEMPT_RT patch and see if the problem goes away. Hopefully this softirq work may make it into the kernel soon. We could even enabled it without full PREEMPT_RT. https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/4.16/patch-4.16.12-rt5.patch.xz -- Steve