From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbbGOTPd (ORCPT ); Wed, 15 Jul 2015 15:15:33 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:37882 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331AbbGOTPb (ORCPT ); Wed, 15 Jul 2015 15:15:31 -0400 X-Helo: d03dlp03.boulder.ibm.com X-MailFrom: paulmck@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 15 Jul 2015 12:15:21 -0700 From: "Paul E. McKenney" To: Oleg Nesterov Cc: Peter Zijlstra , Linus Torvalds , Daniel Wagner , Davidlohr Bueso , Ingo Molnar , Tejun Heo , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] rcu: Create rcu_sync infrastructure Message-ID: <20150715191521.GN3717@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150711233535.GA829@redhat.com> <20150711233548.GA843@redhat.com> <20150715180546.GJ3717@linux.vnet.ibm.com> <20150715181511.GT19282@twins.programming.kicks-ass.net> <20150715182801.GM3717@linux.vnet.ibm.com> <20150715190815.GC2101@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150715190815.GC2101@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15071519-0013-0000-0000-0000141B39D6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2015 at 09:08:15PM +0200, Oleg Nesterov wrote: > On 07/15, Paul E. McKenney wrote: > > > > On Wed, Jul 15, 2015 at 08:15:11PM +0200, Peter Zijlstra wrote: > > > > > > No, it makes the read-side primitive contain an unconditional memory > > > barrier, that forgoes the entire point. > > > > > > The writers are stupidly expensive already for they need global > > > serialization, optimizing them in any way doesn't make sense. > > > > That could well be the case, but it would be good to see the numbers. > > Please see the discussion in another "change sb_writers to use > percpu_rw_semaphore". > > The simple test-case from Dave > > #include > #include > #include > #include > #include > > #define BUFLEN 1 > #define FILESIZE (1 * 1024 * 1024) > > char *testcase_description = "Separate file write"; > > void testcase(unsigned long long *iterations) > { > char buf[BUFLEN]; > char tmpfile[] = "/run/user/1000/willitscale.XXXXXX"; > int fd = mkstemp(tmpfile); > unsigned long size = 0; > > memset(buf, 0, sizeof(buf)); > assert(fd >= 0); > unlink(tmpfile); > > while (1) { > int ret = write(fd, buf, BUFLEN); > assert(ret >= 0); > size += ret; > if (size >= FILESIZE) { > size = 0; > lseek(fd, 0, SEEK_SET); > } > > (*iterations)++; > } > } > > runs 12% faster if we "simply" remove mb's from sb_start/end_write(). > percpu_rw_semaphore does this too and has the approximately same > performance, and we can (hopefully) remove this nontrivial, currently > not 100% correct, and very "special" code in fs/super.c. OK, if that is the type of workload you are using this stuff for, you really don't want read-side memory barriers. Thanx, Paul