From patchwork Tue Feb 8 11:41:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 540451 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p18BfWL4000408 for ; Tue, 8 Feb 2011 11:41:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753517Ab1BHLlb (ORCPT ); Tue, 8 Feb 2011 06:41:31 -0500 Received: from smtp.nokia.com ([147.243.1.47]:51032 "EHLO mgw-sa01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275Ab1BHLla (ORCPT ); Tue, 8 Feb 2011 06:41:30 -0500 Received: from nokia.com (localhost [127.0.0.1]) by mgw-sa01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p18BfQ2x026119; Tue, 8 Feb 2011 13:41:26 +0200 Received: from localhost.localdomain ([[172.21.23.234]]) by mgw-sa01.nokia.com with RELAY id p18Bf29U025530 ; Tue, 8 Feb 2011 13:41:04 +0200 From: Adrian Hunter To: Chris Ball Cc: Adrian Hunter , linux-mmc Mailing List Subject: [PATCH 1/3] mmc_test: make performance test area size about 4MiB Date: Tue, 8 Feb 2011 13:41:01 +0200 Message-Id: <1297165263-656-2-git-send-email-adrian.hunter@nokia.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1297165263-656-1-git-send-email-adrian.hunter@nokia.com> References: <1297165263-656-1-git-send-email-adrian.hunter@nokia.com> X-Nokia-AV: Clean Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 08 Feb 2011 11:41:33 +0000 (UTC) diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index 0131c6c..ec6060c 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -1426,28 +1426,29 @@ static int mmc_test_area_cleanup(struct mmc_test_card *test) } /* - * Initialize an area for testing large transfers. The size of the area is the - * preferred erase size which is a good size for optimal transfer speed. Note - * that is typically 4MiB for modern cards. The test area is set to the middle - * of the card because cards may have different charateristics at the front - * (for FAT file system optimization). Optionally, the area is erased (if the - * card supports it) which may improve write performance. Optionally, the area - * is filled with data for subsequent read tests. + * Initialize an area for testing large transfers. The test area is set to the + * middle of the card because cards may have different charateristics at the + * front (for FAT file system optimization). Optionally, the area is erased + * (if the card supports it) which may improve write performance. Optionally, + * the area is filled with data for subsequent read tests. */ static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill) { struct mmc_test_area *t = &test->area; - unsigned long min_sz = 64 * 1024; + unsigned long min_sz = 64 * 1024, sz; int ret; ret = mmc_test_set_blksize(test, 512); if (ret) return ret; - if (test->card->pref_erase > TEST_AREA_MAX_SIZE >> 9) - t->max_sz = TEST_AREA_MAX_SIZE; - else - t->max_sz = (unsigned long)test->card->pref_erase << 9; + /* Make the test area size about 4MiB */ + sz = (unsigned long)test->card->pref_erase << 9; + t->max_sz = sz; + while (t->max_sz < 4 * 1024 * 1024) + t->max_sz += sz; + while (t->max_sz > TEST_AREA_MAX_SIZE && t->max_sz > sz) + t->max_sz -= sz; t->max_segs = test->card->host->max_segs; t->max_seg_sz = test->card->host->max_seg_size;