Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4245355imm; Wed, 30 May 2018 01:46:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIRlK3mx0syrCiYsdYoaxxTCxnkggR2d+hn1xBT5C5PmmF9vt2rY5nUdw8mmi7GFGPrpwA5 X-Received: by 2002:a63:778b:: with SMTP id s133-v6mr1471677pgc.400.1527669967264; Wed, 30 May 2018 01:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527669967; cv=none; d=google.com; s=arc-20160816; b=KUpyntCb6Yt4L6KR4iTftYsmsvBrm1tp1B78DOqfg603U6Y+gZ4SzGEDfZuo2v9qaP YPyvldPkbNqTwQALo2Apu9VTmA5Dfv8m71KFsa9U26hWUMnKpOCN97FHPsydvj6ThijG rxz3XJzvMwARIQOC16NTxYH4xKEhDwn/zXus++D/7jbvJAzy6UxjXwW6PdczkM6Sk39R dJ6Ygvt+a+q+GP417oDuSCott5pf1OwQn1zRf0JdGHXIjEcP2y+a7Lzr+MDFLVBy0FBE +SYoysCwND0WQ0AW4hXh71c2Lhzj7oU80SLbt2TvnH3rIIS04h2I3akdCFpuTewNUl3V meug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=0tftLsJF7L8ZwDCThlYXphE5L+btinO3Z803r3o9ao8=; b=YPH3uZMDlodCneTTJjkD18UJarsE9oqtpDdssiUQ9ZC4Y3tEn9PxR9x+DWDFiA9XcO JBG9OE0cGqRZUAZ4tdIiJJPMbnztnz4s+r4V1UHvedtMqvizEaEQYG5LwPtydj9u1bGb SfhBHeMt1PiM2WKFoInWujiUEzQYRw/edp/kCzJ022BmGCSITn/5OydH1uAZbHqvpFSE /jqvYsXDBsZ2rXJID6xBUGJra4e+ilJL2YhC3q/jSw1qZKVSqTQB8U51cYBh0DSfAaBS 9EQxiZAwr322fbw+CWOZzPbF+Jgtc5n8BtuqyI/HGYp3TDAYQFK6v767KMi+bU7EKwu/ OjOQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9-v6si9455479plp.182.2018.05.30.01.45.53; Wed, 30 May 2018 01:46:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968728AbeE3Ip0 (ORCPT + 99 others); Wed, 30 May 2018 04:45:26 -0400 Received: from mga14.intel.com ([192.55.52.115]:30130 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964801AbeE3IpX (ORCPT ); Wed, 30 May 2018 04:45:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2018 01:45:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,459,1520924400"; d="scan'208";a="45869232" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.168]) ([10.237.72.168]) by orsmga006.jf.intel.com with ESMTP; 30 May 2018 01:45:19 -0700 Subject: Re: mmc filesystem performance decreased on the first write after filesystem creation To: Christoph Hellwig , Faiz Abbas Cc: "linux-kernel@vger.kernel.org" , linux-omap , linux-mmc , linux-block , Ulf Hansson , Jens Axboe , linux-ext4@vger.kernel.org, tytso@mit.edu References: <20180528062618.GA4196@lst.de> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Wed, 30 May 2018 11:44:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180528062618.GA4196@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/05/18 09:26, Christoph Hellwig wrote: > 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. Older eMMC do not have a "discard" option and use "erase" instead. "Erase" has similar benefits to "discard" but the eMMC is required to make the erased blocks read as either all 0's or all 1's. > > 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. You might want to check the lazy initialization options. I always use "-Elazy_itable_init=0,lazy_journal_init=0" with ext4 to prevent it messing up performance tests. >> >> It would be nice if someone could help me understand why this is happening. >> >> Thanks for your help. >> >> Regards, >> Faiz > ---end quoted text--- >