From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB666C433E0 for ; Sun, 12 Jul 2020 23:05:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96DC4206F0 for ; Sun, 12 Jul 2020 23:05:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eg934yJf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbgGLXFq (ORCPT ); Sun, 12 Jul 2020 19:05:46 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:48157 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727785AbgGLXFp (ORCPT ); Sun, 12 Jul 2020 19:05:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594595144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xBYdTdnXKlelK8bZFQJ36aTsCLk72KGKZGJhxng2yII=; b=eg934yJfneSJSpylXhXJSnJ7syeXDbDxihwVc2HeAKBsmgNTJWN/3h124aI+tZasm7js0R xVyRWZUVga8Mz7LstZfu6SN8W3Wh16SoVeKzoaqZqHzkFxd5hZGpvGmHQsEGf87rrbsC+s gYPXKEiulvgHg4cjnN3RHregNRnB4nc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-116-84IRPjfAMr2mhUkbUawTzA-1; Sun, 12 Jul 2020 19:05:40 -0400 X-MC-Unique: 84IRPjfAMr2mhUkbUawTzA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4581D10059AB; Sun, 12 Jul 2020 23:05:38 +0000 (UTC) Received: from llong.remote.csb (ovpn-112-77.rdu2.redhat.com [10.10.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D7B15C3E7; Sun, 12 Jul 2020 23:05:36 +0000 (UTC) Subject: Re: [PATCH 2/2] locking/pvqspinlock: Optionally store lock holder cpu into lock To: Peter Zijlstra Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , Borislav Petkov , Arnd Bergmann , linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org, Nicholas Piggin , Davidlohr Bueso References: <20200711182128.29130-1-longman@redhat.com> <20200711182128.29130-3-longman@redhat.com> <20200712173452.GB10769@hirez.programming.kicks-ass.net> From: Waiman Long Organization: Red Hat Message-ID: Date: Sun, 12 Jul 2020 19:05:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200712173452.GB10769@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/20 1:34 PM, Peter Zijlstra wrote: > On Sat, Jul 11, 2020 at 02:21:28PM -0400, Waiman Long wrote: >> The previous patch enables native qspinlock to store lock holder cpu >> number into the lock word when the lock is acquired via the slowpath. >> Since PV qspinlock uses atomic unlock, allowing the fastpath and >> slowpath to put different values into the lock word will further slow >> down the performance. This is certainly undesirable. >> >> The only way we can do that without too much performance impact is to >> make fastpath and slowpath put in the same value. Still there is a slight >> performance overhead in the additional access to a percpu variable in the >> fastpath as well as the less optimized x86-64 PV qspinlock unlock path. >> >> A new config option QUEUED_SPINLOCKS_CPUINFO is now added to enable >> distros to decide if they want to enable lock holder cpu information in >> the lock itself for both native and PV qspinlocks across both fastpath >> and slowpath. If this option is not configureed, only native qspinlocks >> in the slowpath will put the lock holder cpu information in the lock >> word. > And this kills it,.. if it doesn't make unconditional sense, we're not > going to do this. It's just too ugly. > You mean it has to be unconditional, no option config if we want to do it. Right? It can certainly be made unconditional after I figure out how to make the optimized PV unlock code work. Cheers, Longman