Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2558720pxa; Mon, 17 Aug 2020 12:43:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoBrKHQs1dnbOTo6bQKWVM4FuHK/jMKFJOl/ljEP7hvD4c5bdDjbxFAfyjlOGAqK+HyM7n X-Received: by 2002:a50:cdd8:: with SMTP id h24mr15990211edj.241.1597693409010; Mon, 17 Aug 2020 12:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597693409; cv=none; d=google.com; s=arc-20160816; b=OKwlvFnBuKN7GW9NI/WRLhATi/tyJXUAqO2A7l8v9xe+PZSbRB7OGbZAZePLrIlESz dLNwLRWRCQvnvuDwqMITm/BUGuPbyXLOAJIh88LC89GmP9lYn2DYPBIQfa2L7tGpYqv0 4FmPIf6W0sKYioVw+eJZjaGeXLepUnAmwFAItZ1HV2sROov+4bkEis7/YnqfEJlGxLXY US6GY9bx3Yd7oWqGyHoZqUOg31mdpGC5M0o/hANdnUqpt1lUa7PCfitilnejmIhLu3pa V536o+HXyVp3Z6CHDJ4iC/n+dke2BLcoMMDg5GQu9+aJzW0pNqEORRDz1KQYLmY+DgCw FnFA== 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; bh=HHXgSOgSzMIqWjh87v1hRN5N6e+kRcLxs/Gi989ThMI=; b=alBpJL71I0hHJAkMyVybzVHL6VCtOaKXinSw2uEEoQkMkzXkJEF7OJNzXORLoygngO rArSjfs231ASzb49Kqozo9YKCxVqq1eUNSPJrC3pI7+63FUZSgJYbWBPp4Ib69AQWOGK +1JqkMNeozFD5OqzymCv/wi0VYBjQEuAK10XgSlwDYx7oxDQwkqkt4gAgu2QxmJEHfwK IbqAvmKk7fDnoj/Crqh0FUC7T4P2VRVSYfIAoBORFO0pirfN/4WA9GTcIFALBYIYFXon EQzXCKuB3zXU8lKiTk/Rfo07Zj8EI1PYTMASdLWQaU1MCVxTyU64lsNaacX0vPMwEBZz yWRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si12135813eja.670.2020.08.17.12.43.05; Mon, 17 Aug 2020 12:43:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404303AbgHQTlj (ORCPT + 99 others); Mon, 17 Aug 2020 15:41:39 -0400 Received: from netrider.rowland.org ([192.131.102.5]:58775 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729708AbgHQPZN (ORCPT ); Mon, 17 Aug 2020 11:25:13 -0400 Received: (qmail 113589 invoked by uid 1000); 17 Aug 2020 11:25:07 -0400 Date: Mon, 17 Aug 2020 11:25:07 -0400 From: Alan Stern To: Jim Baxter Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-usb@vger.kernel.org, "Resch Carsten \(CM/ESO6\)" , "Rosca, Eugeniu \(ADITG/ESB\)" Subject: Re: PROBLEM: Long Workqueue delays. Message-ID: <20200817152507.GC112820@rowland.harvard.edu> References: <71aafe68-7fe0-6b77-ea8e-83edd3f16c8d@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71aafe68-7fe0-6b77-ea8e-83edd3f16c8d@mentor.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 17, 2020 at 12:40:03PM +0100, Jim Baxter wrote: > We have issues with the workqueue of the kernel overloading the CPU 0 > when we we disconnect a USB stick. Do you unmount the stick before disconnecting it? > This results in other items on the shared workqueue being delayed by > around 6.5 seconds with a default kernel configuration and 2.3 seconds > on a config tailored for our RCar embedded platform. > > I am aware there will be delays on the shared workqueue, are the delays > we are seeing considered normal? Assuming the workqueue delay is caused by the USB subsystem, you may be able to get more information by turning on USB dynamic debugging: echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control and seeing what shows up in the dmesg log. One long-running job should not normally be enough to delay an entire workqueues. Workqueues are allowed to spawn multiple threads; they are supposed to resize themselves dynamically as required. Alan Stern