Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp830872ybl; Wed, 11 Dec 2019 08:09:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxj97JOFbAVghYiygCCRI41JaKt1cPnjPXfzAXHn66WuxpVfwoKwa9X0sTeNw9m6wUXrRco X-Received: by 2002:a9d:51ca:: with SMTP id d10mr2766685oth.76.1576080559982; Wed, 11 Dec 2019 08:09:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080559; cv=none; d=google.com; s=arc-20160816; b=IPwQYkxeAon/B0fiBG1LkKa73Xc5tluepy4wbsfaEb8SVw0DIxCj88ZDmUaCiUkfUt hJumz0D7tHH0iEY0YfUAGPcNvvaiJUg3pDWuH5R4d1ZzksnluOE9UpmMGq4o3bKQUTNJ 5VRMhEMKx/gI45y034rWhIK0FFLf4jua3ABFCQyPO149tbGoCJdHLpufGdi+fOEZN1w9 kVTkUA7rOwV56CdUcaEL2Fh2t796AEaslmN+d7CpKtvPElVHgiVUd45ASEttk0+cpBYj DZTWrUkxC41/ZeLHoDyaEoN8aXeCM5gpBW9cFXqq1hxuEFjOZ4jPTFS+QtZ2jDDA9j1C uufQ== 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=seHAMJoikQ8lVZhKscVrMlTB1CQ0/jAZIzhnkq86K2o=; b=O/JbfJwbdgZr5OkyZ5YOPIa/jQ+67WOxolvybAfSYhHV20Yx2FYYReR7Wfo27czCli i+hYm9VQbSAWzTfB3fi/uRuVCONi9mBVTrZaZWCXlCxfXXB2BUy216q6xqx4ZHfdQTmS IvnQ06WD/cLZWq9/CSPyB+k4UZxkexSeqbjHcu5iAFXf5+/8prTFfJsC0COVcYlXB3dO gLxLKF5j4kLGyhN0QZd4puKzlw0pnGGn7yvx6O62+BGBYlu/uF13IR5yW7ta1vePT4iw AX0Ng0ao284UvzqxbGC0mVq6QWc9dDTAk5q1Z6F3vCnSu0PH75wPsWS5Agz9elabTIxc XYhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 l127si1465148oif.11.2019.12.11.08.08.55; Wed, 11 Dec 2019 08:09:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388859AbfLKQIO (ORCPT + 99 others); Wed, 11 Dec 2019 11:08:14 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:54485 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731122AbfLKQIN (ORCPT ); Wed, 11 Dec 2019 11:08:13 -0500 Received: from callcc.thunk.org (guestnat-104-132-34-105.corp.google.com [104.132.34.105] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id xBBG7jbj026860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 11:07:46 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id A4C13421A48; Wed, 11 Dec 2019 11:07:45 -0500 (EST) Date: Wed, 11 Dec 2019 11:07:45 -0500 From: "Theodore Y. Ts'o" To: Ming Lei Cc: Andrea Vai , "Schmid, Carsten" , Finn Thain , Damien Le Moal , Alan Stern , Jens Axboe , Johannes Thumshirn , USB list , SCSI development list , Himanshu Madhani , Hannes Reinecke , Omar Sandoval , "Martin K. Petersen" , Greg KH , Hans Holmberg , Kernel development list , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: AW: Slow I/O on USB media after commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6 Message-ID: <20191211160745.GA129186@mit.edu> References: <20191128091712.GD15549@ming.t460p> <20191129005734.GB1829@ming.t460p> <20191129023555.GA8620@ming.t460p> <320b315b9c87543d4fb919ecbdf841596c8fbcea.camel@unipv.it> <20191203022337.GE25002@ming.t460p> <8196b014b1a4d91169bf3b0d68905109aeaf2191.camel@unipv.it> <20191210080550.GA5699@ming.t460p> <20191211024137.GB61323@mit.edu> <20191211040058.GC6864@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191211040058.GC6864@ming.t460p> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Dec 11, 2019 at 12:00:58PM +0800, Ming Lei wrote: > I didn't reproduce the issue in my test environment, and follows > Andrea's test commands[1]: > > mount UUID=$uuid /mnt/pendrive 2>&1 |tee -a $logfile > SECONDS=0 > cp $testfile /mnt/pendrive 2>&1 |tee -a $logfile > umount /mnt/pendrive 2>&1 |tee -a $logfile > > The 'cp' command supposes to open/close the file just once, however > ext4_release_file() & write pages is observed to run for 4358 times > when executing the above 'cp' test. Why are we sure the ext4_release_file() / _fput() is coming from the cp command, as opposed to something else that might be running on the system under test? _fput() is called by the kernel when the last reference to a struct file is released. (Specifically, if you have a fd which is dup'ed, it's only when the last fd corresponding to the struct file is closed, and the struct file is about to be released, does the file system's f_ops->release function get called.) So the first question I'd ask is whether there is anything else going on the system, and whether the writes are happening to the USB thumb drive, or to some other storage device. And if there is something else which is writing to the pendrive, maybe that's why no one else has been able to reproduce the OP's complaint.... - Ted