Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp898688ybi; Wed, 17 Jul 2019 06:37:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX0aAkYZ3R6e2kfby9JEG7JPOv2Mrrl1Q2LYFwyrPVBNp/RDzc501nWhWQKi/GmpAB8pQB X-Received: by 2002:a17:90a:bb8a:: with SMTP id v10mr44620697pjr.78.1563370679295; Wed, 17 Jul 2019 06:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563370679; cv=none; d=google.com; s=arc-20160816; b=DMXwi5GmV66rs3WMfGIiaGf35zx3GSi7+tUcVuSMnFLBmX6fDfO1DRN6mVMrGjP+5W a7+5/nZa/MC81B991bmhkEUutRcsKU8bqYz3elP5cMrlrPqfNIT/XpBZ/tk4bRJKlTKl LCIsLiA/RpZk5cP5GuUJkb92x0PLr/JkrJ5j3iFYBZLdVn8qd6Iq3tQAufZnt4iM+T4T cVBLsC6F0UhCCZELHhshzSv79dIqK2pC9rTq9Vb7hhATK8Daz+nCNIzCrXaLHU04IE5Z eQ+I+1jg8ZbSlNU2Dwak8Zgh6QOr3uIhgdggyJ+jKcrA7oL7zCF9v0kCMU6dD6J3OUk2 Q1ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=OwzQ8dp8/rocoN30zzypi8SUonsxK2w9UW+73iwhQFQ=; b=0Algn5aUg4+mWC+0LxfK2msqYEZ/jbej6/KJnVbQmXgjY7Jndgfb5pKUbS8aoNddHg KcGN0Rrr9T81mFr7SDd44PpNzqAtWlj14o/lVn6UwUsBXzFcgXoHdfl9Z4a6kTHiZJkG FeWzqVoc3zO8h4yQRXkDzHDSQ9GLdxz5v+uvpgQJMaTBKyg74WgwVBl7vzq8kDO63Llp p90ule6Cd0KCXt3uw3Ys944PFz0/M1tCz/wGT6b3Viiz8UYpi9fzUhMqa0aXV+RH+QMO 95TqjHKcD1xgUNmeQ59Od/GNaJhTPUKnNW2Oa4nVJ0LmNF6jX1SBZ+k4FvSnkkVQAs1v 1IeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si8701055pfj.79.2019.07.17.06.37.42; Wed, 17 Jul 2019 06:37:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727264AbfGQNft (ORCPT + 99 others); Wed, 17 Jul 2019 09:35:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54742 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbfGQNft (ORCPT ); Wed, 17 Jul 2019 09:35:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EFE3159465; Wed, 17 Jul 2019 13:35:48 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-160.bos.redhat.com [10.18.17.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85BC65DA34; Wed, 17 Jul 2019 13:35:46 +0000 (UTC) Subject: Re: [PATCH v3 3/5] locking/qspinlock: Introduce CNA into the slow path of qspinlock To: Peter Zijlstra Cc: Alex Kogan , linux@armlinux.org.uk, mingo@redhat.com, will.deacon@arm.com, arnd@arndb.de, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, x86@kernel.org, guohanjun@huawei.com, jglauber@marvell.com, steven.sistare@oracle.com, daniel.m.jordan@oracle.com, dave.dice@oracle.com, rahul.x.yadav@oracle.com References: <20190715192536.104548-1-alex.kogan@oracle.com> <20190715192536.104548-4-alex.kogan@oracle.com> <9fa54e98-0b9b-0931-db32-c6bd6ccfe75b@redhat.com> <20190717074435.GU3419@hirez.programming.kicks-ass.net> From: Waiman Long Organization: Red Hat Message-ID: <378093ad-46cc-7ecb-5a06-1e22ee5ce4a1@redhat.com> Date: Wed, 17 Jul 2019 09:35:46 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190717074435.GU3419@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 17 Jul 2019 13:35:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/17/19 3:44 AM, Peter Zijlstra wrote: > On Tue, Jul 16, 2019 at 10:16:29PM -0400, Waiman Long wrote: >> A simple graphic to illustrate those queues will help too, for example > Very much yes! > >> /* >>  * MCS lock holder >>  * =============== >>  *    mcs_node >>  *   +--------+      +----+         +----+ >>  *   | next   | ---> |next| -> ...  |next| -> NULL  [Main queue] >>  *   | locked | -+   +----+         +----+ >>  *   +--------+  | >>  *               |   +----+         +----+ >>  *               +-> |next| -> ...  |next| -> X     [Secondary queue] >>  *    cna_node       +----+         +----+ >>  *   +--------*                       ^ >>  *   | tail   | ----------------------+ >>  *   +--------*    > Almost; IIUC that cna_node is the same as the one from locked, so you > end up with something like: > >>  *    mcs_node >>  *   +--------+      +----+         +----+ >>  *   | next   | ---> |next| -> ...  |next| -> NULL  [Main queue] >>  *   | locked | -+   +----+         +----+ >>  *   +--------+  | >>  *               |   +---------+         +----+ >>  *               +-> |mcs::next| -> ...  |next| -> NULL     [Secondary queue] >> * |cna::tail| -+ +----+ >>  *          +---------+ | ^ >> * +--------+ >>  * >>  * N.B. locked = 1 if secondary queue is absent. >>  */ Yes, you are right. Thanks for the correction. Cheers, Longman