From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751591AbcFYR3M (ORCPT ); Sat, 25 Jun 2016 13:29:12 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48855 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123AbcFYR3K convert rfc822-to-8bit (ORCPT ); Sat, 25 Jun 2016 13:29:10 -0400 X-IBM-Helo: d28dlp03.in.ibm.com X-IBM-MailFrom: xinhui@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Content-Type: text/plain; charset=gb2312 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] locking/osq: Drop the overload of osq lock From: panxinhui In-Reply-To: <20160625161307.GZ30927@twins.programming.kicks-ass.net> Date: Sun, 26 Jun 2016 01:27:51 +0800 Cc: panxinhui , Boqun Feng , Pan Xinhui , linux-kernel@vger.kernel.org, mingo@redhat.com, dave@stgolabs.net, will.deacon@arm.com, Waiman.Long@hpe.com, benh@kernel.crashing.org Content-Transfer-Encoding: 8BIT References: <1466876523-33437-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160625142447.GK30154@twins.programming.kicks-ass.net> <20160625152130.GA2452@insomnia> <20160625160922.GL30154@twins.programming.kicks-ass.net> <20160625161307.GZ30927@twins.programming.kicks-ass.net> To: Peter Zijlstra X-Mailer: Apple Mail (2.3124) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062517-0008-0000-0000-000002CB4E4B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062517-0009-0000-0000-00000DC4BCAF Message-Id: <90D0C23D-65D5-40A8-89F1-4D02506A9CBC@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-25_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606250207 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 在 2016年6月26日,00:13,Peter Zijlstra 写道: > > On Sat, Jun 25, 2016 at 06:09:22PM +0200, Peter Zijlstra wrote: >> That works here, but it would not work for the need_resched() in >> mutex_spin_on_owner() and mutex_optimistic_spin() which need equal >> treatment. >> >> Because those too we want to limit. >> >> The count thing, while a little more cumbersome, is more widely >> applicable than just the one OSQ case where we happen to have a cpu >> number. > > Although I suppose that mutex_spin_on_owner() (and with that the rsem > variant) could use task_cpu(lock->owner) once we've established that the > owner pointer is still valid. > > yes, What I am going to fix next is these XXX_spin_on_owner, including mutex_spin_on_owner, rwsem_spin_on_owner …. by the way I still think mutex_unlock has a big overload too.