From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwGz5-0004i2-67 for qemu-devel@nongnu.org; Tue, 31 Jul 2012 14:15:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwGz3-0002BD-MN for qemu-devel@nongnu.org; Tue, 31 Jul 2012 14:15:55 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:54273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwGz3-0002B4-Fs for qemu-devel@nongnu.org; Tue, 31 Jul 2012 14:15:53 -0400 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Jul 2012 12:15:51 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 8F9273E40046 for ; Tue, 31 Jul 2012 18:15:47 +0000 (WET) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6VIFMvk130736 for ; Tue, 31 Jul 2012 12:15:24 -0600 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6VIFJ9d009640 for ; Tue, 31 Jul 2012 12:15:21 -0600 From: Anthony Liguori In-Reply-To: <501816D0.9040207@samsung.com> References: <1343417387-13953-1-git-send-email-i.mitsyanko@samsung.com> <1343417387-13953-11-git-send-email-i.mitsyanko@samsung.com> <501816D0.9040207@samsung.com> Date: Tue, 31 Jul 2012 13:15:13 -0500 Message-ID: <87wr1jyez2.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH V4 10/12] SD card users: optimize access to SDClass methods List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mitsyanko , Peter Maydell Cc: kwolf@redhat.com, benoit.canet@gmail.com, wdongxu@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com, e.voevodin@samsung.com, qemu-devel@nongnu.org, armbru@redhat.com, andrew.zaborowski@intel.com, kyungmin.park@samsung.com, pbonzini@redhat.com Igor Mitsyanko writes: > On 07/31/2012 07:43 PM, Peter Maydell wrote: >> On 27 July 2012 20:29, Igor Mitsyanko wrote: >>> Rather that repeatedly call SD_GET_CLASS() in a loop, call it once before >>> a loop starts. >> Anthony claims that SD_GET_CLASS should be cheap enough that we don't >> need to hoist it out of loops like this. Do you have profiling data >> or similar that caused you to write this patch? >> >> -- PMM >> > Well, I've tested it by measuring an execution time of a 4Kb write to SD > card, results showed that arithmetic mean of time for one 4k write was > less by ~300us in sequence with SD_GET_CLASS extracted from the loop. How many loop iterations that? 300us is a huge amount of time, unless you were looping on every byte, I have a hard time understanding that delta. Regards, Anthony Liguori > Although I ran this test several times, I have little faith in test > methodology and results, it obviously showed significant dispersion > between measured time of distinct 4K writes (200-300% if I recall > correctly). I really have no objection no objection to dropping this patch.