From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr50128.outbound.protection.outlook.com ([40.107.5.128]:64182 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727048AbeHGOul (ORCPT ); Tue, 7 Aug 2018 10:50:41 -0400 Subject: Re: [PATCH 2/2] fuse: Move clear_bit() up in request_end() To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org References: <153303268481.387.10809229593975235816.stgit@localhost.localdomain> <153303273523.387.7541221195413649436.stgit@localhost.localdomain> From: Kirill Tkhai Message-ID: Date: Tue, 7 Aug 2018 15:32:25 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07.08.2018 15:22, Miklos Szeredi wrote: > On Tue, Jul 31, 2018 at 12:25 PM, Kirill Tkhai wrote: >> Nobody can clear FR_BACKGROUND bit on processing >> request in parallel, so it's possible to do it >> out of fc->lock. > > Moving such a cheap operation outside the splinlock won't make any > difference in real life. It's not about difference in real life, it's about readability. Testing the bit outside the lock and clearing it inside the lock confuses a reader, and makes he to thing there is a tricky synchronization, while there is no tricky synchronization. > And anyway the biggest problem with fc->lock is not contention (hold > for long period of time), I would guess, but cachline pingponging > (being acquired on different CPUs one after the other). > > So there's definitely work to do regarding locking in fuse, but it > needs a bigger axe. I've moved background stuff at a separate lock in my sandbox tree, and this was pretty easy. Not yet sent to you, since I'm going to do some performance testing on this. I've locked for tests used to measure the performance in fuse git log, but there is no one pointing in the log I found. Could you tell, what fuse driver do you use to measure performance and which test you use? Kirill