From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: RFC: Micro-optimize direct IO submission path Date: Wed, 22 Jun 2011 12:18:36 -0700 Message-ID: <1308770322-22565-1-git-send-email-andi@firstfloor.org> Cc: linux-kernel@vger.kernel.org, dehrenberg@google.com To: linux-fsdevel@vger.kernel.org Return-path: Received: from mga09.intel.com ([134.134.136.24]:39981 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932502Ab1FVTUV (ORCPT ); Wed, 22 Jun 2011 15:20:21 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Inspired by the recent fast path DIO patch from Daniel Ehrenberg. I spent some time micro optimizing the "slow" direct IO submission part. This should get rid of large parts of the memset and dio access costs that Dan noticed. I moved everything that isn't needed in the completion handler back into the stack, to make it more likely it's cache hot. It also inlines everything to allow the compiler to optimize more. In particular it can split up the sdio structure into individual variables now and then get rid of unnecessary initializations. This costs some text size, but I think it's worth for such a hot path. And the dio is a slab now, which avoids some fast path overhead. Dan, could you please test this patch in your test case, comparing against the fast path again? Please test with CONFIG_CC_OPTIMIZE_FOR_SIZE and CONFIG_OPTIMIZE_INLINING both disabled. Thanks, -Andi