Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2018628imm; Sun, 27 May 2018 23:21:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrOgpcheqtcknHxHMGeT9nWREuXXJcz2E3VAMr7jCz96w8g9Gtn75jHlkcG+TikF5kwS8iX X-Received: by 2002:a17:902:6ac3:: with SMTP id i3-v6mr12217515plt.378.1527488503095; Sun, 27 May 2018 23:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527488503; cv=none; d=google.com; s=arc-20160816; b=rq2wvJru6pvbBix3i/QzAy7Ze8udJg8O8GzhChWH+WDGOFAVzsxtrlWnCwmrbqi501 BLpOw74cl3v79+RanzFAdTRuzoCNelI18UPd69pEba2ydilNC8wogvwilolUx5dHMgQq b5Y96ULml59KCFYVDToex51tjAzcHT1B+MkMBA4TK6eiXAIf7cROCoOcMcyn63AaMDP/ b7mD1q06B4ZA6thRARF3KC1gr4EETj8ET0ohyeCVI9CvwC5dsO2c5DwCDigK9N2WRmTL Tgu/ej5KPfdhh1KSzMv2SOcjo3ado8yUywan1uC/O9FwOjQXIKu7ekrrN+C1GxT0g5L1 3nIA== 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:arc-authentication-results; bh=ikAlB7ACAW7FPUvbhoDwAhpozMtsc1B+ewaFpMf35TA=; b=hbngME97Luw928kf7cv3y+JwNoGpeS1cqfZUrch2DUbbS/bnNEPj6nOPxYfZA4yLex ak7yJTtbBfuIEi14buEwfTnS/nxcPMPOLcJMoYSu9g0kv8pY8utjAqmkeTiDliz2gtNP gCtOQq75S2JtqQNKIWy1Mgg5sJ8Hdlwzfq1E0bW9dHIEF3C24CWXlvf/s5wG8lF6t7j8 5+Yaha62in3ECmoUr8I6GM2H9UdNPQhyFrlf1etjvwiAqOMlIflFeg70D5zpy47i9+aq cd+97L28+Lre/dwP0VBMK57suCcbhtsN3IWCszCZnSHvOFFA8fyIYouDilFH16ygSGDJ t9ZQ== 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 g13-v6si6119946pgq.124.2018.05.27.23.21.28; Sun, 27 May 2018 23:21: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; 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 S1753478AbeE1GUT (ORCPT + 99 others); Mon, 28 May 2018 02:20:19 -0400 Received: from verein.lst.de ([213.95.11.211]:46996 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750725AbeE1GUR (ORCPT ); Mon, 28 May 2018 02:20:17 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id A5B7268E43; Mon, 28 May 2018 08:26:18 +0200 (CEST) Date: Mon, 28 May 2018 08:26:18 +0200 From: Christoph Hellwig To: Faiz Abbas Cc: "linux-kernel@vger.kernel.org" , linux-omap , linux-mmc , linux-block , Christoph Hellwig , Ulf Hansson , Jens Axboe , linux-ext4@vger.kernel.org, tytso@mit.edu Subject: Re: mmc filesystem performance decreased on the first write after filesystem creation Message-ID: <20180528062618.GA4196@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Summary: mke2s uses the BLKDISCARD ioctl to wipe the device, and then uses BLKDISCARDZEROES to check if that zeroed the data. A while ago I made BLKDISCARDZEROES always return 0 because it is basically impossible to have reliably zeroing using discard as the standards leave the devices way to many options to not actually zero data at their own choice when using the discard commands. So IFF mke2fs want to actually free space and zero it it needs to use fallocate to punch a hole, and mmc needs to implement REQ_OP_WRITE_ZEROS IFF it actually has a reliable way to zero blocks. On Tue, May 22, 2018 at 08:48:31PM +0530, Faiz Abbas wrote: > Hi, > > I am debugging a performance reduction in ext2 filesystems on an mmc > device in TI's am335x evm board. > > I see that the performance is reduced on the first write after making a > new filesystem using mkfs.ext2 on one of the mmc partitions. The > performance comes back to normal after the first write. > > commands used: > > => umount /dev/mmcblk1p2 > > => mkfs.ext2 -F /dev/mmcblk1p2 > > => mount -t ext2 -o async /dev/mmcblk1p2 /mnt/partition_mmc > > => dd if=/dev/urandom of=/dev/shm/srctest_file_mmc_1184 bs=1M count=10 > > => ./filesystem_tests -write -src_file /dev/shm/srctest_file_mmc_1184 > -srcfile_size 10 -file /mnt/partition_mmc/test_file_1184 -buffer_size > 102400 -file_size 100 -performance > > The filesystem_tests write utility reads from the file generated at > /dev/shm/srctest_file_mmc_1184, memory maps the file to a buffer, and > then writes it into the newly created /mnt/partition_mmc in multiples of > buffer_size while measuring write performance. > > See here for the implementation of filesystem_tests write utility: > http://arago-project.org/git/projects/?p=test-automation/ltp-ddt.git;a=blob;f=testcases/ddt/filesystem_test_suite/src/testcases/st_filesystem_write_to_file.c;h=80e8e244d7eaa9f0dbd9b21ea705445156c36bef;hb=f7fc06c290333ce08a7d4fba104eee0f0f1d942b > > Complete log with multiple calls to filesystem_tests: > https://pastebin.ubuntu.com/p/BckmTJpqPv/ > > Notice that the first run of filesystem_tests has a lower throughput > reported. > > I was able to bisect the issue to this commit: > 5d1429fead5b (mmc: remove the discard_zeroes_data flag) > > I would assume that after this flag is removed, the filesystem creation > command would explicitly write zeroes to the device which might explain > the performance fall. However, then the mkfs.ext2 command itself should > take more time rather than the first file write after that. > > It would be nice if someone could help me understand why this is happening. > > Thanks for your help. > > Regards, > Faiz ---end quoted text---