Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5643641imm; Tue, 12 Jun 2018 10:53:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ+BmDHJqcQIhYVbsq7ldmwJEuo4KMIQsv0O24+PNvZOL7zjDE54vt3IIBh+htBW/qZj8nC X-Received: by 2002:a63:6ac5:: with SMTP id f188-v6mr1161959pgc.195.1528826023771; Tue, 12 Jun 2018 10:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528826023; cv=none; d=google.com; s=arc-20160816; b=VKDjaUh++3zFndhT6OViv1gv/q/NK/lxBXUQUkJ1Rbod0eOpXSYfrmaKfBLrgjFE8y niWrrLJXAX0fcuXCgQ/03yFG7J5k8GCYBdCJCzb3/T/DIZJFIrwYikda1SqTjK8TZpAe BxcZessRnk7IFuiiPqRH+rQHNnPjpmgTu22tw8DRsAvzywp+wORS6BfAHPR3IykNtnTN Ufab43wWjloqOi5ZP5o8JEaq3zvf1NZPO78sY81D8Ixzfv0tcWYWsp6xT1y81CMBGSw8 iHxE6miuKvnJZcWPGw6+vZr5e7mO0l3YB2ssfMQwXFmPJ7w6XYe3XuP88208RY5MU3zk y5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=pj51uNyANT6EsJISjq9VLnC2JeUjYTI0xTGVxDqViB0=; b=q1YmchkxIR3nsr1yCO8VoKVUQdzi4iIBcKf0YKCgwvuYOc6C/cUZaZG9Z0Sp9C52d9 wUxVuFsNKJkNSaeoIGQhZs7CMk983BSZC0P6YOzGSVcr79OYRv++LYnixBLodLmBBdkt Sc+m4q/bUPQqesa4QnfmiRybXMQQQex7seL21f5TQgcy+3DbyDXmoKDUWb+XgCo11a3U v+kk7IGGut3rNxI4Yq15LAaKU0bZijT/tl6zRIaSynPZ4GYl35dasnDVL08p+Y/a0DJE aHWevpAcQbSQDo0RFLwp2KlzsBEtSOB3emJ27jPjDaV2FqgbWK2j+tvonfRyuPf1tD10 gTXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ghBD451V; 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 k185-v6si503356pgc.468.2018.06.12.10.53.29; Tue, 12 Jun 2018 10:53:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ghBD451V; 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 S1754372AbeFLRxF (ORCPT + 99 others); Tue, 12 Jun 2018 13:53:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:49114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754056AbeFLRxE (ORCPT ); Tue, 12 Jun 2018 13:53:04 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 198C220891; Tue, 12 Jun 2018 17:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528825983; bh=aAERSOix1p8OcjwrDDU6VsLhS/tV9+fgqFMBu11b3gM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ghBD451VimzzB+fTV1vTZEZXnxdX9ECopmCIW2HwKcoVaWV+Wla9Vua6jE9skwfef 5oVL3Zv/5E43XN6OHpMILaVi32v72/rL3EawH9G7utxCSac8eL3vosHN1iJ5Y03EmT t1I45w6I9dsk8DO4P2s1dJprzpEEfW2GLcz8G1Ao= Date: Tue, 12 Jun 2018 19:52:42 +0200 From: Greg Kroah-Hartman To: Mikulas Patocka Cc: Alan Stern , Ming Lei , USB list , Kernel development list Subject: Re: [PATCH] usb: don't offload isochronous urb completions to ksoftirq Message-ID: <20180612175242.GA12855@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 01:19:28PM -0400, Mikulas Patocka wrote: > > > On Tue, 12 Jun 2018, Alan Stern wrote: > > > On Tue, 12 Jun 2018, Mikulas Patocka wrote: > > > > > > How about making the softirq thread's priority adjustable? > > > > > > But you would have to argue with softirq maintainers about it - and you > > > say that you don't have time for that. > > > > But maybe _you_ do... > > ksoftirqd has priority 0 - it is not suitable for real-time tasks, such as > audio. > > In my opinion, it is much easier to fix this in the ehci driver (by not > offloading isochronous completions), than to design a new > real-time-capable ksoftirqd. Ok, but what happens when you plug your device into a xhci controller? Do we also need to change that? Only touching a specific host controller is not good, you will be playing "whack a mole" for forever. Isoc packets are, by definition, not supposed to be guaranteed at all. So if they are "slow" or dropped or delayed somehow, that's fine. The sound protocol should be fine with it. Now yes, in reality, as you have found out, things can be "tight" on low-powered processors under heavy load. But what you are doing here is a priority inversion. You do not solve such a thing by going around and raising everything else up as well, this is supposed to be a "general purpose" kernel. You can tune a specific machine/device just fine this way, but not by messing with the kernel for the most part. > > > > As for coordinating with the softirq maintainers -- whether I want to > > > > or not isn't the issue. Right now I don't have _time_ to do it. > > > > > > > > Alan Stern > > > > > > I am wondering - whats the purpose of that patch > > > 428aac8a81058e2303677a8fbf26670229e51d3a at all? The patch shows some > > > performance difference, but they are minor, about 1%. > > > > > > If you want to call the urb callback as soon as possible - why don't you > > > just call it? Why do you need to offload the callback to a softirq thread? > > > > Please read the Changelog entry for commit 94dfd7edfd5c. Basically the > > idea was to reduce overall latency by not doing as much work in an > > interrupt handler. > > > > Alan Stern > > snd_complete_urb is doing nothing but submitting the same urb again. Is > resubmitting the urb really causing so much latency that you can't do it > in the interrupt handler? snd_complete_urb() does much more than just submition of the same urb. Perhaps if this is a real problem, the sound driver should have more than one urb pending? Is there a pool here that is somehow getting used up? thanks, greg k-h