From patchwork Thu Jan 14 20:58:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Peterson X-Patchwork-Id: 8035391 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 99E399F1C0 for ; Thu, 14 Jan 2016 20:58:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3835204E4 for ; Thu, 14 Jan 2016 20:58:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1525204B5 for ; Thu, 14 Jan 2016 20:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755905AbcANU6y (ORCPT ); Thu, 14 Jan 2016 15:58:54 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:37508 "EHLO mx4-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752505AbcANU6y (ORCPT ); Thu, 14 Jan 2016 15:58:54 -0500 Received: from zmail12.collab.prod.int.phx2.redhat.com (zmail12.collab.prod.int.phx2.redhat.com [10.5.83.14]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0EKwr6u019591; Thu, 14 Jan 2016 15:58:53 -0500 Date: Thu, 14 Jan 2016 15:58:53 -0500 (EST) From: Bob Peterson To: linux-fsdevel@vger.kernel.org Cc: Al Viro Message-ID: <287059480.9694215.1452805133579.JavaMail.zimbra@redhat.com> In-Reply-To: <288541983.9689922.1452804546109.JavaMail.zimbra@redhat.com> Subject: [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead MIME-Version: 1.0 X-Originating-IP: [10.3.113.226] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF43 (Linux)/8.0.6_GA_5922) Thread-Topic: readahead: fix block ordering in __do_page_cache_readahead Thread-Index: UgcL9cWoqVky/INF/HHLBOhFXWrSTg== Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I just ran into this today. I had temporarily disabled readpages in GFS2 in order to test something and discovered, to my surprise, that the block IOs were being issued in reverse order. In my case, the block_map function was called in reverse block order. In other words: lblock started at 8, then proceeded to 7, 6, 5, 4, 3, 2, 1, 0. So I surmised the order must be wrong. After a little digging, I whipped up this little patch. Can anyone out there corroborate this or tell me if I've I lost my mind? Viro? I'll add my Signed-off-by but I really haven't tested it or anything. It's kind of moot for file systems with readpages, but it might be worth doing. Regards, Bob Peterson Red Hat File Systems Signed-off-by: Bob Peterson --- -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/mm/readahead.c b/mm/readahead.c index ba22d7f..b76fb34 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -185,7 +185,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp, if (!page) break; page->index = page_offset; - list_add(&page->lru, &page_pool); + list_add_tail(&page->lru, &page_pool); if (page_idx == nr_to_read - lookahead_size) SetPageReadahead(page); ret++;