From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933531AbbDIT7s (ORCPT ); Thu, 9 Apr 2015 15:59:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42903 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933327AbbDIT7q (ORCPT ); Thu, 9 Apr 2015 15:59:46 -0400 Message-ID: <1428609577.24035.3.camel@stgolabs.net> Subject: Re: [PATCH 2/2] locking/rwsem: Use a return variable in rwsem_spin_on_owner() From: Davidlohr Bueso To: Jason Low Cc: Linus Torvalds , Paul McKenney , Ingo Molnar , Peter Zijlstra , Tim Chen , Aswin Chandramouleeswaran , LKML Date: Thu, 09 Apr 2015 12:59:37 -0700 In-Reply-To: <1428608618.12911.9.camel@j-VirtualBox> References: <1428521960-5268-1-git-send-email-jason.low2@hp.com> <1428521960-5268-3-git-send-email-jason.low2@hp.com> <20150409053725.GB13871@gmail.com> <1428561611.3506.78.camel@j-VirtualBox> <20150409075311.GA4645@gmail.com> <20150409175652.GI6464@linux.vnet.ibm.com> <1428608618.12911.9.camel@j-VirtualBox> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-04-09 at 12:43 -0700, Jason Low wrote: > So that looks more similar to how the original code was where the > rcu_read_lock() and rcu_read_unlock() was done inside the owner_running > helper function (though without the CONFIG_DEBUG_PAGEALLOC), before > commit 307bf9803f25 ("sched: Simplify mutex_spin_on_owner()") modified > it to be done outside the loop. I think this is why Linus was mentioning the CONFIG_PREEMPT_RCU case as well, so taking and releasing the read lock in those cases in the loop would actually hurt more. Thanks, Davidlohr