From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932080AbbC0JAy (ORCPT ); Fri, 27 Mar 2015 05:00:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35445 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753369AbbC0JAu (ORCPT ); Fri, 27 Mar 2015 05:00:50 -0400 Date: Fri, 27 Mar 2015 02:01:59 -0700 From: Andrew Morton To: Christoph Hellwig Cc: Milosz Tanski , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, Mel Gorman , Volker Lendecke , Tejun Heo , Jeff Moyer , "Theodore Ts'o" , Al Viro , linux-api@vger.kernel.org, Michael Kerrisk , linux-arch@vger.kernel.org, Dave Chinner Subject: Re: [PATCH v7 0/5] vfs: Non-blockling buffered fs read (page cache only) Message-Id: <20150327020159.eadd0ce1.akpm@linux-foundation.org> In-Reply-To: <20150327084833.GA7689@infradead.org> References: <20150326202824.65d03787.akpm@linux-foundation.org> <20150327081822.GA28669@infradead.org> <20150327013516.8c6788be.akpm@linux-foundation.org> <20150327084833.GA7689@infradead.org> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.18.9; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Mar 2015 01:48:33 -0700 Christoph Hellwig wrote: > On Fri, Mar 27, 2015 at 01:35:16AM -0700, Andrew Morton wrote: > > fincore() doesn't have to be ugly. Please address the design issues I > > raised. How is pread2() useful to the class of applications which > > cannot proceed until all data is available? > > It actually makes them work correctly? preadv2( ..., DONTWAIT) will > return -EGAIN, which causes them to bounce to the threadpool where > they call preadv(...). (I assume you mean RWF_NONBLOCK) That isn't how pread2() works. If the leading one or more pages are uptodate, pread2() will return a partial read. Now what? Either the application reads the same data a second time via the worker thread (dumb, but it will usually be a rare case) or it reads the remainder of the data in the worker thread and splices the data back together. Which, as I said, will often result in a second load of the initial read result into CPU cache.