Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933944AbcKPTTb (ORCPT ); Wed, 16 Nov 2016 14:19:31 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:40511 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933799AbcKPTT0 (ORCPT ); Wed, 16 Nov 2016 14:19:26 -0500 X-ME-Sender: X-Sasl-enc: oJ1Vb5T9pQdJqQidc8VTcJqK/EBfDp9wmZVnHmNvQVwW 1479323965 From: Nikolaus Rath To: Maxim Patlasov Cc: linux-fsdevel , linux-kernel , Miklos Szeredi , Subject: Re: [fuse-devel] fuse: max_background and congestion_threshold settings References: <87oa1g90nx.fsf@thinkpad.rath.org> <64a57faa-d3a6-a209-8728-723ed7f37c2f@virtuozzo.com> Mail-Copies-To: never Mail-Followup-To: Maxim Patlasov , linux-fsdevel , linux-kernel , Miklos Szeredi , Date: Wed, 16 Nov 2016 11:19:24 -0800 In-Reply-To: <64a57faa-d3a6-a209-8728-723ed7f37c2f@virtuozzo.com> (Maxim Patlasov's message of "Tue, 15 Nov 2016 09:38:18 -0800") Message-ID: <87fumrmdvn.fsf@thinkpad.rath.org> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uAGJJgvt005229 Content-Length: 1791 Lines: 39 Hi Maxim, On Nov 15 2016, Maxim Patlasov wrote: > On 11/15/2016 08:18 AM, Nikolaus Rath wrote: >> Could someone explain to me the meaning of the max_background and >> congestion_threshold settings of the fuse module? >> >> At first I assumed that max_background specifies the maximum number of >> pending requests (i.e., requests that have been send to userspace but >> for which no reply was received yet). But looking at fs/fuse/dev.c, it >> looks as if not every request is included in this number. > > fuse uses max_background for cases where the total number of > simultaneous requests of given type is not limited by some other > natural means. AFAIU, these cases are: 1) async processing of direct > IO; 2) read-ahead. As an example of "natural" limitation: when > userspace process blocks on a sync direct IO read/write, the number of > requests fuse consumed is limited by the number of such processes > (actually their threads). In contrast, if userspace requests 1GB > direct IO read/write, it would be unreasonable to issue 1GB/128K==8192 > fuse requests simultaneously. That's where max_background steps in. Ah, that makes sense. Are these two cases meant as examples, or is that an exhaustive list? Because I would have thought that other cases should be writing of cached data (when writeback caching is enabled), and asynchronous I/O from userspace...? Also, I am not sure what you mean with async processing of direct I/O. Shouldn't direct I/O always go directly to the file-system? If so, how can it be processed asynchronously? Best, -Nikolaus -- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.«