From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756386AbbE3Ut6 (ORCPT ); Sat, 30 May 2015 16:49:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53165 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750856AbbE3Utu (ORCPT ); Sat, 30 May 2015 16:49:50 -0400 Date: Sat, 30 May 2015 22:49:00 +0200 From: Oleg Nesterov To: Linus Torvalds Cc: Peter Zijlstra , Paul McKenney , Tejun Heo , Ingo Molnar , Linux Kernel Mailing List , der.herr@hofr.at, Davidlohr Bueso Subject: Re: [RFC][PATCH 5/5] percpu-rwsem: Optimize readers and reduce global impact Message-ID: <20150530204900.GA17772@redhat.com> References: <20150526114356.609107918@infradead.org> <20150526120215.042527659@infradead.org> <20150529194534.GA31860@redhat.com> <20150529200932.GA2516@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 05/29, Linus Torvalds wrote: > > On Fri, May 29, 2015 at 1:09 PM, Oleg Nesterov wrote: > > > > Doesn't it need mb() before "state = readers_slow" to ensure > > "release" semantics? > > Please don't do any mb() at all. Just do smp_store_release() if > release semantics is what you want. Agreed! > (And try to make sure to pair it with smp_load_acquire() on the other > side for things to make sense) Hmm. I think you are right... __percpu_down_read() lacks another mb() after the "state != BLOCK" check for the same reason, and we can use smp_load_acquire(state) instead. Oleg.