From mboxrd@z Thu Jan 1 00:00:00 1970 From: Theodore Ts'o Subject: Re: [PATCH] dio: Fast-path for page-aligned IOs Date: Wed, 29 Jun 2011 21:03:50 +0000 (UTC) Message-ID: References: <1308611855-18096-1-git-send-email-dehrenberg@google.com> <20110621214413.GB3263@one.firstfloor.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from lo.gmane.org ([80.91.229.12]:46454 "EHLO lo.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757937Ab1F2VKK (ORCPT ); Wed, 29 Jun 2011 17:10:10 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qc21O-0003Cy-U5 for linux-fsdevel@vger.kernel.org; Wed, 29 Jun 2011 23:10:06 +0200 Received: from 74.125.60.1 ([74.125.60.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jun 2011 23:10:06 +0200 Received: from tytso by 74.125.60.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jun 2011 23:10:06 +0200 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Andi Kleen firstfloor.org> writes: > > You're right that these preconditions are rather rigid, though. If you > > have a suggestion for a more general precondition, I can try it out > > and see if it maintains the performance properties I want. > > Not fully sure, but I would be interested in support for 512 byte sectors > at least. Looking at the code while I've been reviewing it, it seems to me that a goodly amount of the speedup is due to the fact that we can add pages to the bio one full page at a time, using bio_add_page() in a simple for loop. The original code, has to go through the whole direct_io_worker(), do_direct_IO(), submit_page_section(), dio_send_cur_page(), and dio_bio_add_page(). That's 8 lines of code in the fast path, and close to 400 lines of code in the generic section. (Is it at all surprising the proposed fast path code is faster?) Most of this is due to the need to deal with file systems where the block sizes don't line up with the page sizes. So supporting file systems with sub-page-size block sizes is what introduces all of the hair. -- Ted