Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1055340ybl; Thu, 23 Jan 2020 12:40:56 -0800 (PST) X-Google-Smtp-Source: APXvYqyV/U/HofEfOZrp5x+0rMZ0jCu3DXz6E0UqRQwkT3SSX1t3RowoMwFhiBtTQ8zBl4vcqQ0A X-Received: by 2002:aca:d484:: with SMTP id l126mr11497393oig.114.1579812055940; Thu, 23 Jan 2020 12:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579812055; cv=none; d=google.com; s=arc-20160816; b=z4kbr4Q03IHaWby7wqZ/ULslBEZIeZtBOB0x4mJ7C7tf0KPkVVynZnUXHj6HkX/6Cc Q9rimlQjcBoB1EImsjlqlqD/vw9nXq0CSMV4uQSN659o1y/PJ9AUXYiyYAt/duL1tRcx 6miHpOngE5OIAYphutyd4diL8zK8YoMqmrMRgOOLy2Hek/cJTWVPheYBD8WqWAAv6ost POI2r5IM4MRHbrmy6sTpZ5xNXIYAGXXxtcuOSQTznvUnkrLoKB9Pv0q30UajXMjmH8Tz lCsSDzlHKC6w2NX4XVqiiTs6rak8uQCmaqW0iHds9URTa0+gUFsIAA62vEEN4Ntzm8Lq yQQA== 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:references:cc:to:from:subject :dkim-signature; bh=MyE9Ytq4amd8dy1aNSoOTSin79NmbQ0RcZM9I95mUT0=; b=voKinCXtdIf6E+MYYys1DminIU5kQ+R2AR1ReMBs4OUcBDBmBO2xNTiaRK65UJisrX Bw8Bbeq4Lv6V3i0qJkIDOM42re4+ApU6EC7KoC4mp/r7I4x+OP9hbXZSiMfGPc+iSjvG z/uXIgg0eeYx1oZqoDlUJSgZr+Ki3QngSarNlppUIG1mf1rQoth3p1Qt4dU+Hrveb9Fv fn/gPrnX2qyg5hFU0DKXlbBIft+K9G09zKNiNnzoBL2x43I3dfDDVejAoCrvQ0Rc72PD FIQdIZdlUrS8Cuvr7RcJo+TosC8efoNgNXvPELDmqCgZTj7tZ8kOxQ9AHXebh08f2nzm wYXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=STJAmv29; 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=pass (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 n11si1630360otk.290.2020.01.23.12.40.43; Thu, 23 Jan 2020 12:40:55 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=STJAmv29; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729106AbgAWUjL (ORCPT + 99 others); Thu, 23 Jan 2020 15:39:11 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23985 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726167AbgAWUjL (ORCPT ); Thu, 23 Jan 2020 15:39:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579811950; 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=MyE9Ytq4amd8dy1aNSoOTSin79NmbQ0RcZM9I95mUT0=; b=STJAmv29aw/1UJ5kiPoVoiX31pHlUVqSiD3QvSucw6+MOPoQ/LsXdhOqYdH3dKd2eEl6aI +HsKMftT4pwm5x0vc0MCJvj36xW2uK/gnqB/UHpkEEd83NL6TpIQO1XjtuyG1Gsz3OK50U 65AZ8Ktj012bFhWLYkHrtTX6HxccPOc= 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-274-D5EjJrCwNdypAXS4I0YCEQ-1; Thu, 23 Jan 2020 15:39:06 -0500 X-MC-Unique: D5EjJrCwNdypAXS4I0YCEQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08E1F14E2; Thu, 23 Jan 2020 20:39:04 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-59.bos.redhat.com [10.18.17.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50FE185741; Thu, 23 Jan 2020 20:39:01 +0000 (UTC) Subject: Re: [PATCH v9 4/5] locking/qspinlock: Introduce starvation avoidance into CNA From: Waiman Long To: Alex Kogan , linux@armlinux.org.uk, peterz@infradead.org, 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 Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, dave.dice@oracle.com References: <20200115035920.54451-1-alex.kogan@oracle.com> <20200115035920.54451-5-alex.kogan@oracle.com> Organization: Red Hat Message-ID: <5f865b62-4867-2c7b-715a-0605759e647f@redhat.com> Date: Thu, 23 Jan 2020 15:39:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/23/20 2:55 PM, Waiman Long wrote: > Playing with lock event counts, I would like you to change the meaning > intra_count parameter that you are tracking. Instead of tracking the > number of times a lock is passed to a waiter of the same node > consecutively, I would like you to track the number of times the head > waiter in the secondary queue has given up its chance to acquire the > lock because a later waiter has jumped the queue and acquire the lock > before it. This value determines the worst case latency that a secondary > queue waiter can experience. So Well, that is not strictly true as a a waiter in the middle of the secondary queue can go back and fro between the queues for a number of times. Of course, if we can ensure that when a FLUSH_SECONDARY_QUEUE is issued, those waiters that were in the secondary queue won't be put back into the secondary queue again. The parameter will then really determine the worst case latency. One way to do it is to store the tail of the secondary queue into the CNA node and passed it down the queue until it matches the current encoded tail. That will require changing both numa_node and intra_count into u16 to squeeze out space for another u32. That will also make the code a bit easier to analyze. Cheers, Longman