Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5696099imm; Tue, 12 Jun 2018 11:45:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL7zqGyJc/WbDNc7S6n0O18P9PCUqRgt+1XRU9xkYcoinifA+6UQofSZPhjMhbiPR+1LOHO X-Received: by 2002:a65:4e09:: with SMTP id r9-v6mr1274169pgt.369.1528829148269; Tue, 12 Jun 2018 11:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528829148; cv=none; d=google.com; s=arc-20160816; b=qzdG+JidOn0BLChiMJGxyBhQw2qvsZtanmPrW6uUS5adnJzlmnxdO2/jCJhGa+LEd7 aaIRCaMPOUFRegrBTOhgR4YWh4jXUNqvbVxWwdB26EZyQIkAevUM56JVyXJyQnBC8WOj rpSgJUOc0MWOxWAitfHtTXLDz9+EH8lSPV09RLtPU28Rkmb3wSTq3jcfwQb9A3rKW9Ye GJ21iL72PJtLKx1iJCg+JA/iG/PLKoap70G000LwXQe7mT7wcnqmSiJCDucbtlFuZiF2 pkDDhoibOkF0iap4smTYHNdeLEw+BZ1a03Cb4ZKQm28ppNp0tfn8T/oDa8QrKFYucRWt Asag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=JcjHexePKK6VbmyIYxXb9XvvRg6zpNSxhzrM4ulo4so=; b=CQx9l6aLCHeJcSnbt3uKYftzVO3R41qdIp4hg0ntwSLxQnNG3iJrq6X8KyuqRSLHRB tLSFjnn/6bpQ/bqzPvoKj/+hqqG8XKAWg+qpZaxLOxaf/tMI7ucF3+XdqxKAK+wE2hkt TIutiPOzULbCcMu6IGD2+ZZE1N1x91wifCfervo9QL7q9SizeBYOxcJKgvAm/zwIOGMj TpRv/o90hlI+uCFyYVQYAmGdiWoJPnzG375g0O61RMMSWl+0W5X2lANPTfr8k68zPJRr qs60vrgO3Ws7N+UJaHpJAxaEFvKJo97/LupuLX2SymCLUQ9zE3PAPrg01SfcAB28F+2k Vyjw== 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 n4-v6si644591plp.128.2018.06.12.11.45.33; Tue, 12 Jun 2018 11:45:48 -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 S932744AbeFLSo5 (ORCPT + 99 others); Tue, 12 Jun 2018 14:44:57 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:47756 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932343AbeFLSo4 (ORCPT ); Tue, 12 Jun 2018 14:44:56 -0400 Received: (qmail 4999 invoked by uid 2102); 12 Jun 2018 14:44:55 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 12 Jun 2018 14:44:55 -0400 Date: Tue, 12 Jun 2018 14:44:55 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Mikulas Patocka cc: Ming Lei , Greg Kroah-Hartman , USB list , Kernel development list Subject: Re: [PATCH] usb: don't offload isochronous urb completions to ksoftirq In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Jun 2018, 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. There have been suggestions posted to this mailing list for changing the USB stack to use a threaded interrupt routine instead of a tasklet for this purpose. Would that make your situation any better? > 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. You probably never noticed this, but in fact we use _two_ bottom-half handlers for URB completions: one scheduled with normal priority and one scheduled with high priority (tasklet_hi_schedule()). Isochronous URB completions go to the high-priority handler. Shouldn't a high-priority tasklet be up to the job of handling audio? > > > > 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? Perhaps snd_complete_urb doesn't doing very much, but other drivers most definitely do. In particular, the completion handler for the USB video class driver can be very time consuming. Your proposed change would make things worse for people using USB video. Alan Stern