From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753186AbbC0GEA (ORCPT ); Fri, 27 Mar 2015 02:04:00 -0400 Received: from mail.SerNet.de ([193.175.80.2]:33523 "EHLO mail.SerNet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753123AbbC0GD6 (ORCPT ); Fri, 27 Mar 2015 02:03:58 -0400 X-Greylist: delayed 1345 seconds by postgrey-1.27 at vger.kernel.org; Fri, 27 Mar 2015 02:03:57 EDT Date: Fri, 27 Mar 2015 06:41:25 +0100 From: Volker Lendecke To: Andrew Morton Cc: Milosz Tanski , linux-kernel@vger.kernel.org, Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, Mel Gorman , 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) Reply-To: Volker.Lendecke@SerNet.DE References: <20150326202824.65d03787.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150326202824.65d03787.akpm@linux-foundation.org> User-Agent: Mutt/1.5.21 (2010-09-15) Message-Id: Organization: SerNet GmbH, Goettingen, Germany Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2015 at 08:28:24PM -0700, Andrew Morton wrote: > A thing which bugs me about pread2() is that it is specifically > tailored to applications which are able to use a partial read result. > ie, by sending it over the network. Can you explain what you mean by this? Samba gets a pread request from a client for some bytes. The client will be confused when we send less than requested although the file is long enough to satisfy all. > And of course fincore could be used by Samba etc to avoid blocking on > reads. It wouldn't perform quite as well as pread2(), but I bet it's > good enough. > > Bottom line: with pread2() there's still a need for fincore(), but with > fincore() there probably isn't a need for pread2(). fincore would be a second syscall per pread, and it is not atomic. I've had discussions with MIPS based vendors who are worried about every single syscall. This is the #1 hottest code path in Samba. > And I'm doubtful about claims that it absolutely has to be non-blocking > 100% of the time. I bet that 99.99% is good enough. A fincore() > option to run mark_page_accessed() against present pages would help > with the race-with-reclaim situation. If you can make sure that after an fincore the pages remain in memory for x milliseconds the atomicity concern might go away. Volker -- SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen http://www.sernet.de, mailto:kontakt@sernet.de