From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753538AbbGOTJ6 (ORCPT ); Wed, 15 Jul 2015 15:09:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46627 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752494AbbGOTJ5 (ORCPT ); Wed, 15 Jul 2015 15:09:57 -0400 Date: Wed, 15 Jul 2015 21:08:15 +0200 From: Oleg Nesterov To: "Paul E. McKenney" 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: <20150715190815.GC2101@redhat.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150715182801.GM3717@linux.vnet.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Oleg.