From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753944AbbGNVRH (ORCPT ); Tue, 14 Jul 2015 17:17:07 -0400 Received: from mga11.intel.com ([192.55.52.93]:22192 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753364AbbGNVRG (ORCPT ); Tue, 14 Jul 2015 17:17:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,474,1432623600"; d="scan'208";a="728904558" Message-ID: <55A57C50.1080406@linux.intel.com> Date: Tue, 14 Jul 2015 14:17:04 -0700 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Oleg Nesterov , Jan Kara CC: Al Viro , Linus Torvalds , Paul McKenney , Peter Zijlstra , Daniel Wagner , Davidlohr Bueso , Ingo Molnar , Tejun Heo , linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 0/4] change sb_writers to use percpu_rw_semaphore References: <20150713212536.GA13855@redhat.com> <20150714104810.GB24369@quack.suse.cz> <20150714133731.GA24837@redhat.com> In-Reply-To: <20150714133731.GA24837@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/14/2015 06:37 AM, Oleg Nesterov wrote: > On 07/14, Jan Kara wrote: >> So unless >> I'm missing something and there is a significant performance advantage to >> Dave's patches I'm all for using a generic primitive you suggest. > > I think percpu_rw_semaphore looks a bit better. And even a bit faster. > And it will not block __sb_start_write() entirely while freeze_super() > sleeps in synchronize_rcu(). That's true, but freeze_super() and the code blocked by it is a super-rare path compared with write(). > freeze_super() should be faster too after rcu_sync changes, but this > is not that important. > > But again, to me the main advantage is that we can use the generic > primitives and remove this nontrivial code in fs/super.c. > >> Can you perhaps work with Dave on some common resolution? > > Dave, what do you think? Will you agree with percpu_rw_semaphore ? Using my little write-1-byte test (under will-it-scale), your 4 patches improves the number of writes/sec by 12%. My 3 patches improve the number of writes/sec by 32%. My patches manage to get rid of the memory barriers entirely in the fast path. Your approach keeps the barriers. Test: https://www.sr71.net/~dave/intel/write1byte.c