From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Allison Subject: Re: [PATCH v7 0/5] vfs: Non-blockling buffered fs read (page cache only) Date: Mon, 30 Mar 2015 13:49:37 -0700 Message-ID: <20150330204937.GB4987@samba2> References: <20150326202824.65d03787.akpm@linux-foundation.org> <20150327081822.GA28669@infradead.org> <20150327013516.8c6788be.akpm@linux-foundation.org> <20150327084833.GA7689@infradead.org> <20150327020159.eadd0ce1.akpm@linux-foundation.org> <20150327155854.GA5548@samba2> <20150330073604.GB22229@infradead.org> <20150330132625.52b1250527ca3dcda79e349e@linux-foundation.org> <20150330203227.GA4987@samba2> <20150330133758.d2788f6de72f121170ff0301@linux-foundation.org> Reply-To: Jeremy Allison Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jeremy Allison , Christoph Hellwig , 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 To: Andrew Morton Return-path: Received: from fn.samba.org ([216.83.154.106]:45856 "EHLO mail.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbbC3Utk (ORCPT ); Mon, 30 Mar 2015 16:49:40 -0400 Content-Disposition: inline In-Reply-To: <20150330133758.d2788f6de72f121170ff0301@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Mar 30, 2015 at 01:37:58PM -0700, Andrew Morton wrote: > On Mon, 30 Mar 2015 13:32:27 -0700 Jeremy Allison wrote: > > > On Mon, Mar 30, 2015 at 01:26:25PM -0700, Andrew Morton wrote: > > > > > > cons: > > > > > > d) fincore() is more expensive > > > > > > e) fincore() will very occasionally block > > > > The above is the killer for Samba. If fincore > > returns true but when we schedule the pread > > we block, we're hosed. > > > > Once we block, we're done serving clients on the main > > thread until this returns. That can cause unpredictable > > response times which can cause client timeouts. > > > > A fincore+pread solution that blocks is simply unsafe > > to use for us. We'll have to stay with the threadpool :-(. > > Finally. Thanks ;) > > This implies that the samba main thread also has to avoid any memory > allocations both direct and within syscall and pagefault - those will > occasionally exhibit similar worse-case latency. Is this done now? We don't do anything special around allocations in syscall. For aio read we do talloc (internal memory allocator) the return chunk before going into the pthread pread, so I suppose this could block. Haven't seen this as a reported problem though. I suppose you can say "well exactly the same thing is true of fincore()" :-).