From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751740AbcFZCWa (ORCPT ); Sat, 25 Jun 2016 22:22:30 -0400 Received: from mail-it0-f53.google.com ([209.85.214.53]:38897 "EHLO mail-it0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751568AbcFZCW3 (ORCPT ); Sat, 25 Jun 2016 22:22:29 -0400 Date: Sun, 26 Jun 2016 10:26:32 +0800 From: Boqun Feng To: Peter Zijlstra Cc: panxinhui , 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 Subject: Re: [PATCH] locking/osq: Drop the overload of osq lock Message-ID: <20160626022632.GE2384@insomnia> References: <1466876523-33437-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160625142447.GK30154@twins.programming.kicks-ass.net> <20160625152130.GA2452@insomnia> <20160625161540.GM30154@twins.programming.kicks-ass.net> <20160625164527.GD2384@insomnia> <20160625192025.GP30154@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TdkiTnkLhLQllcMS" Content-Disposition: inline In-Reply-To: <20160625192025.GP30154@twins.programming.kicks-ass.net> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --TdkiTnkLhLQllcMS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 25, 2016 at 09:20:25PM +0200, Peter Zijlstra wrote: > On Sun, Jun 26, 2016 at 01:27:56AM +0800, panxinhui wrote: > > >> Would that not have issues where the owner cpu is kept running but t= he > > >> spinner (ie. _this_ vcpu) gets preempted? I would think that in that > > >> case we too want to stop spinning. > > >>=20 > > >=20 > > do you mean that the spinner detect itself had yield out during the > > big spin loop? > >=20 > > It is very possible to happen. BUT if spinner(on this vcpu) yield > > out, the next spinner would break the spin loop. AND if spinner > > detect itself yield out once, it=E2=80=99s very possible to get the osq= lock > > soon as long as the ower vcpu is running. > >=20 > > SO I think we need just check the owner vcpu=E2=80=99s yield_count. >=20 > I had a quick look at KVM and it looks like it only has > kvm_cpu::preempted, which would suggest the interface boqun proposed. >=20 > We'll have to look at many of the other virt platforms as well to see > what they can do. >=20 > We could also provide _both_ interfaces and a platform can implement > whichever variant (or both) it can. >=20 Make sense ;-) Lemme cook something for further discussions. Regards, Boqun --TdkiTnkLhLQllcMS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXbz1UAAoJEEl56MO1B/q49YIH/0oWF7yGN1RaVeGlf7EikIPs J6kw1AiwQHXQnJxTtMleW+9A9FvvmJZSor7NaPE2miKhChAS1KIk/Pj1WNk+1QyF t483lciqZrsYb3osVrVAV0uoyInomAGM91LDrmQPh2IpoHz5anqMuimoTyqhELid fNpZUMbYVg+ZFVcWOXa21wxMJOIIgltoC47PWnKxAZQ0t3KyRixXuIiIwAkDxXdO NWzVMvLjnkhrxng9uRwtLtV3xAMyVMiUaKCWr1UGDdtK18HBHx1fTsxMOPC92MMZ CpsWGIpsJs55h5CiVyHywCLvwtOHQKoHVTWnF4n6BG2xUQOljl698gNHHsduhMA= =35VY -----END PGP SIGNATURE----- --TdkiTnkLhLQllcMS--