From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754319AbcAVQqm (ORCPT ); Fri, 22 Jan 2016 11:46:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:42312 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754251AbcAVQqk (ORCPT ); Fri, 22 Jan 2016 11:46:40 -0500 Date: Fri, 22 Jan 2016 08:46:30 -0800 From: Davidlohr Bueso To: Waiman Long Cc: Ding Tianhong , Peter Zijlstra , Ingo Molnar , "linux-kernel@vger.kernel.org" , Linus Torvalds , "Paul E. McKenney" , Thomas Gleixner , Will Deacon , Jason Low , Tim Chen , Waiman Long Subject: Re: [PATCH RFC] locking/mutexes: don't spin on owner when wait list is not NULL. Message-ID: <20160122164630.GA1633@linux-uzut.site> References: <56A0A4ED.3070308@huawei.com> <56A1638A.7050202@hpe.com> <20160122060944.GA28537@linux-uzut.site> <56A230C3.4070801@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <56A230C3.4070801@hpe.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jan 2016, Waiman Long wrote: >The patch that I sent out is just a proof of concept to make sure >that it can fix that particular case. I do plan to refactor it if I >decide to go ahead with an official one. Unlike the OSQ, there can be >no more than one waiter spinner as the wakeup function is directed to >only the first task in the wait list and the spinning won't happen >until the task is first woken up. In the worst case scenario, there >are only 2 spinners spinning on the lock and the owner field, one >from OSQ and one from the wait list. That shouldn't put too much >cacheline contention traffic to the system. Similarly, I guess we should also wakeup the next waiter in line after releasing the wait_lock via wake_q. This would allow the woken waiter a slightly better chance of finding the wait_lock free when continuing to take the mutex. Thanks, Davidlohr