From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88814C433E1 for ; Tue, 18 Aug 2020 14:48:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56CC0207DE for ; Tue, 18 Aug 2020 14:48:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56CC0207DE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D21948D000E; Tue, 18 Aug 2020 10:48:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CAB248D0003; Tue, 18 Aug 2020 10:48:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B71A78D000E; Tue, 18 Aug 2020 10:48:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 9D9908D0003 for ; Tue, 18 Aug 2020 10:48:20 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4EB22362B for ; Tue, 18 Aug 2020 14:48:20 +0000 (UTC) X-FDA: 77163969960.16.alarm72_150070c27020 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 16228100E6903 for ; Tue, 18 Aug 2020 14:48:20 +0000 (UTC) X-HE-Tag: alarm72_150070c27020 X-Filterd-Recvd-Size: 2244 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by imf12.hostedemail.com (Postfix) with SMTP for ; Tue, 18 Aug 2020 14:48:19 +0000 (UTC) Received: (qmail 146374 invoked by uid 1000); 18 Aug 2020 10:48:18 -0400 Date: Tue, 18 Aug 2020 10:48:18 -0400 From: Alan Stern To: Jim Baxter Cc: Greg KH , 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: <20200818144818.GB144306@rowland.harvard.edu> References: <71aafe68-7fe0-6b77-ea8e-83edd3f16c8d@mentor.com> <20200817115744.GA3985908@kroah.com> <57a7841d-86e3-b6df-1488-a252a68a9ee0@mentor.com> <20200817184753.GA120209@rowland.harvard.edu> <1838f2c3-7915-9e5b-3112-6b082b945410@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1838f2c3-7915-9e5b-3112-6b082b945410@mentor.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 16228100E6903 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Aug 18, 2020 at 11:54:51AM +0100, Jim Baxter wrote: > On 17/08/2020 19:47, Alan Stern wrote: > > > > Unplugging a R/W USB drive without unmounting it first is a great way to > > corrupt the data. > > > Thank you, post development we will only mount the USB stick as R/O. > > >> Using perf Iidentified the hub_events workqueue was spending a lot of time in > >> invalidate_partition(), I have included a cut down the captured data from perf in > >> [2] which shows the additional functions where the kworker spends most of its time. > > > > invalidate_partition() is part of the block layer, not part of USB. It > > gets called whenever a drive is removed from the system, no matter what > > type of drive it is. You should ask the people involved in that > > subsystem why it takes so long. > > > > I included the linux-mm list but missed the filesystem, I will ask the question > to the linux-fsdevel too. What about linux-block? The block layer is different from the memory-management (mm) layer. Alan Stern