Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbaBRTHQ (ORCPT ); Tue, 18 Feb 2014 14:07:16 -0500 Received: from mail-ve0-f182.google.com ([209.85.128.182]:43679 "EHLO mail-ve0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbaBRTHK (ORCPT ); Tue, 18 Feb 2014 14:07:10 -0500 MIME-Version: 1.0 In-Reply-To: <20140218185323.GB5744@linux.intel.com> References: <1392662333-25470-1-git-send-email-kirill.shutemov@linux.intel.com> <53035FE2.4080300@redhat.com> <100D68C7BA14664A8938383216E40DE04062DEA1@FMSMSX114.amr.corp.intel.com> <20140218185323.GB5744@linux.intel.com> Date: Tue, 18 Feb 2014 11:07:09 -0800 X-Google-Sender-Auth: MdcnV4nvKJkDW0Ffn2PX1ld7cj4 Message-ID: Subject: Re: [RFC, PATCHv2 0/2] mm: map few pages around fault address if they are in page cache From: Linus Torvalds To: Matthew Wilcox Cc: "Wilcox, Matthew R" , Rik van Riel , "Kirill A. Shutemov" , Andrew Morton , Mel Gorman , Andi Kleen , Dave Hansen , Alexander Viro , Dave Chinner , linux-mm , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2014 at 10:53 AM, Matthew Wilcox wrote: > > Yes, I did mean "holepunches and page faults". But here's the race I see: Hmm. With truncate, we should be protected by i_size being changed first (iirc - I didn't actually check), but I think you're right that hole punching might race with a page being mapped at the same time. > What I'm suggesting is going back to Kirill's earlier patch, but only > locking the page with the highest index instead of all of the pages. > truncate() will block on that page and then we'll notice that some or > all of the other pages are also now past i_size and give up. Actually, Kirill's latest patch seems to solve the problem with locking - by simply never locking more than one page at a time. So I guess it's all moot at least wrt the page preload.. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/