From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH 0/10] fuse: An attempt to implement a write-back cache policy Date: Thu, 05 Jul 2012 13:01:30 +0400 Message-ID: <4FF557EA.7020705@parallels.com> References: <4FF3156E.8030109@parallels.com> <87a9zg1b7q.fsf@vostro.rath.org> <4FF3EC9B.6030605@parallels.com> <4FF4438B.8050807@rath.org> <4FF45447.5000705@parallels.com> <4FF47886.9040107@rath.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "fuse-devel@lists.sourceforge.net" , linux-fsdevel To: Nikolaus Rath Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:19156 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895Ab2GEJCH (ORCPT ); Thu, 5 Jul 2012 05:02:07 -0400 In-Reply-To: <4FF47886.9040107@rath.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07/04/2012 09:08 PM, Nikolaus Rath wrote: > On 07/04/2012 10:33 AM, Pavel Emelyanov wrote: >>>>>> A good solution of this is switching the FUSE page cache into a write-back policy. >>>>>>>>>> With this file data are pushed to the userspace with big chunks (depending on the >>>>>>>>>> dirty memory limits, but this is much more than 128k) which lets the FUSE daemons >>>>>>>>>> handle the size updates in a more efficient manner. >>>>>>>>>> >>>>>>>>>> The writeback feature is per-connection and is explicitly configurable at the >>>>>>>>>> init stage (is it worth making it CAP_SOMETHING protected?) >>>>>>>> >>>>>>>> From your description it sounds as if the only effect of write-back is >>>>>>>> to increase the chunk size. Why the need to require special >>>>>>>> privileges for this? >>>>>> >>>>>> Provided I understand the code correctly: if FUSE daemon turns writeback on and sets >>>>>> per-bdi dirty limit too high it can cause a deadlock on the box. Thus then daemon >>>>>> should be trusted by the kernel, i.e. -- privileged. >>>> >>>> Wouldn't it be more reasonable to enforce that the bdi dirty limit is >>>> not set too high then? >> >> Hardly, since if you have several mounts with small bdi limit each the sum of them >> can be still high. > > Yeah, so isn't it possible to put a limit on the sum of them? Only on FUSE mounts? Currently no, only on the overall dirty set. Which, in turn, will affect disk filesystems behavior. > I think it would be much better if this could be made safe to use > instead of requiring special privileges. If that isn't possible, > wouldn't it be better to enable/disable the feature in /etc/fuse.conf, > similar to the user_allow_* options? I'll look at it. > Having to explain how to assign capabilities in the documentation of a > fuse filesystem sounds quite dreadful to me... > > > Best, > > -Nikolaus > > > PS: My naive attempt to apply your patches to my Debian 3.2 kernel > failed. I'm compiling 3.5rc5 at the moment - will see if I can get it to > boot afterwards... > >