From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D8C3BA0C44; Mon, 29 Mar 2021 20:09:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64A42406B4; Mon, 29 Mar 2021 20:09:31 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60049.outbound.protection.outlook.com [40.107.6.49]) by mails.dpdk.org (Postfix) with ESMTP id 04DB74069D for ; Mon, 29 Mar 2021 20:09:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y529DnbvV3y2RWVHotQ/jonCNdIEJnQ2ijk7qO0VIGs=; b=gro8QuRKuCKUYOL4NlQRqqW6SGvCmDQf4y8yph5iTyIR/meJN6EWPB58VCoxuiyJr3c9DBJyhr1rFDvV5va/JfwHqfJP4matysnHdfTTUrLKNr6F2iiQe1K0YPjAsp79Nhi8raixtscZzDKv3IPIV5BE1qHClklv0lzdozVxSjU= Received: from AM6P191CA0002.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::15) by DB7PR08MB3388.eurprd08.prod.outlook.com (2603:10a6:10:41::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.31; Mon, 29 Mar 2021 18:09:17 +0000 Received: from AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8b:cafe::f1) by AM6P191CA0002.outlook.office365.com (2603:10a6:209:8b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Mon, 29 Mar 2021 18:09:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT061.mail.protection.outlook.com (10.152.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 18:09:16 +0000 Received: ("Tessian outbound 24fdfdedd45c:v89"); Mon, 29 Mar 2021 18:09:15 +0000 X-CR-MTA-TID: 64aa7808 Received: from 92db0aa52208.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 37311356-42EE-411A-87DD-F197726F6E5B.1; Mon, 29 Mar 2021 18:09:05 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 92db0aa52208.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 29 Mar 2021 18:09:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YEpIavAem8YwNI/NubAa+k8y+rv8MxrZkktJgNbn+mWhrZSb7tmugIMpp9uiKTPosJiTLcmCyyv/P8LPnb2C+fXn/VWi2+AoMpzmHen01HcVshU/Q4zSQMKMDHpvQdxCrAoXhSFV+3ZExfnvlGbQGHVJyQ7oOVcPb4nziB3A0beh+VjwbK/aVV0oOa02HBaqRozzmeJJ+DlgDOUIHg3dPqxJXoMIWGa+nhmWNeF6lucfaJc/O927/J3UnsXjbX39LsWY/vBvLRQN4qMTKYAG0x3VuZsXddY557Dz7qa8aZNJH+vxzVgv5FVIq3trVKXRbkTkGZrldu1y41KXuQmb0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y529DnbvV3y2RWVHotQ/jonCNdIEJnQ2ijk7qO0VIGs=; b=cWT/PzgxMZDbhuQCPw58uCeDy7eaNVNO1YQ20xvmIbGVB7YMTPM75pnfD0MhORolnhFn9kbVwZYSMZ5q1EE8HZ+nqcneb7x1bokdKi9XRoiT9WLo4TvJwTXV/uhVz+0j+9mUcZB4+BZhqcxp6dqDJCM6N5LcMzJk2bcqh5yb7QZlBCFYY+YmgKncTsL3nFvcCcNY37IakGHEhmf+9ZI83ZPPRW03oWnxuE9Adm4ht9Cd6BVCY5bXfluQs1NHrYP7LpToQOrVtVZXTNyky3T4SAmCLvwG8q8fZjw+FzvetdMImEZDuqerb22LaazS+r2AIT15iNlmeijxtpJUnZxFeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y529DnbvV3y2RWVHotQ/jonCNdIEJnQ2ijk7qO0VIGs=; b=gro8QuRKuCKUYOL4NlQRqqW6SGvCmDQf4y8yph5iTyIR/meJN6EWPB58VCoxuiyJr3c9DBJyhr1rFDvV5va/JfwHqfJP4matysnHdfTTUrLKNr6F2iiQe1K0YPjAsp79Nhi8raixtscZzDKv3IPIV5BE1qHClklv0lzdozVxSjU= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB9PR08MB6363.eurprd08.prod.outlook.com (2603:10a6:10:257::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Mon, 29 Mar 2021 18:09:04 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::2994:a01e:2de:f94e]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::2994:a01e:2de:f94e%7]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 18:09:02 +0000 From: Honnappa Nagarahalli To: Stephen Hemminger CC: "dev@dpdk.org" , Stephen Hemminger , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v3] pflock: implementation of phase-fair reader writer locks Thread-Index: AQHXEGI/IcKJ0QLg6kiRYsPAmdlFQaqZ1DswgAGLPICAAAwzgA== Date: Mon, 29 Mar 2021 18:09:02 +0000 Message-ID: References: <20210212013838.312623-1-sthemmin@microsoft.com> <20210303191945.94617-1-sthemmin@microsoft.com> <20210329102239.1932a7a6@hermes.local> In-Reply-To: <20210329102239.1932a7a6@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: A2FFA2871AB6564889EE3CC67579DDE4.0 x-checkrecipientchecked: true Authentication-Results-Original: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.113.13.105] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bed8dd3f-fc68-4d48-ed73-08d8f2ddc3e7 x-ms-traffictypediagnostic: DB9PR08MB6363:|DB7PR08MB3388: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:2000;OLM:2000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Vunr4WISj+ayE0ZbMAZQVmiIPuV+GVS0UaVBRdPOIcRxYjNAyHlOoGLAIF9FBG4/fx1WVqNyBUJNINMmM22HZ4vDjrJCKQKIxNIWSKNy6avjnezDSV9yz2dKMl1QsZFVDOvCx+QToqEMRuOZzKwSPSM6L5VNnovzQGXIsYMPJBsRWchEfDS6fJBNsezHcTGJr/8TPWeAJy4corT7NnP0YDHeyZITwbghc25V7QTJMJGG9iWLypBppTkcMsLyYpG5QWYZ6CQQ8DEUFq9WkY0WAt7tq75qFqGhEVvf4jPc+n/tDDV0DCI/CIXerZM5MHSeZSPbwwc8ZFlM4k+IAQO1ieBXFJWiHaiLKaWrSKfWSrfTTQh92v/QxKNESEfx9+erqb26rQ8mx0gY5Stlq27JRNjzYuEaIv1MyrZIkXxuiklalO8pLBjB6c10ZsstyL2QuQwGq8VTuNl3kgXuM75IUChN88o86FAN+aqm2JgmaSNpluvgXcWrTvPHqkayXWpFxl4a9s7Vyg6sQ8MBQ7j4xyLGOXTuqbhOZgD21szLlpCMqnFSBo6bGFShL40RyVjxB9YOLYWY+J5QB0MElkKZ/rrfDJa/JV+bI/KHZyF80iqSLgZHxVhi3r/NVwUSQUW4VcmQVhOY07aU6yY6WVEdmxH3gin7jQcgJXKajbcBcrDkYvhH+9vhGIAvjtNVU8hQdOwP4/9gMFyRp3kA8i4uvqqsLY9vttYAlRBUjp++3BE3CAQ0feMdodWRZrY5XszH X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(346002)(136003)(39860400002)(4326008)(26005)(7696005)(6506007)(186003)(8936002)(33656002)(8676002)(86362001)(52536014)(55016002)(66556008)(966005)(64756008)(66446008)(66476007)(9686003)(38100700001)(5660300002)(76116006)(478600001)(66946007)(2906002)(316002)(54906003)(6916009)(83380400001)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?pYnH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Eb?= =?us-ascii?Q?qaS7sA0e/RFbOlYINyZ5t12pa6vc+KqKCtySaMdQYmXpKwuXm6VITDwLe95q?= =?us-ascii?Q?bdvR+RVuL1wp33Bd49k4UvLsmSgsTUbBm4vIuS/Eh+LyUNSHg0mdo2kdrPbE?= =?us-ascii?Q?RR3OJbRMdUQO44/9VsMOSJnM+uAKDA1ozlX5fSE6L2I6gpBjTVO9XG812fQZ?= =?us-ascii?Q?k6YkBIk586y0BlbsYzrqFruce5q65C+8DA+T5T5UOfSrZ1172Pxw48S2O3eE?= =?us-ascii?Q?KHaZGHkcDXRsTvBwWng/495Ls+hql3+FSu2j6GDmgM5XSYVA9ph/LZ7uUWeF?= =?us-ascii?Q?YdjMsaV9DUrI5c3T4Ju78O3J4afY5/DDl4bQtNAyn47ji5P4DQ3sYPma/q6t?= =?us-ascii?Q?t3b3+mwusN95jJkok6MkwKndSIvibZAmz/aufgg38d8CcFiQdoas1hgQ7Knw?= =?us-ascii?Q?QyfGbhYWWHldPt1iR7I+YJIA?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6363 Original-Authentication-Results: networkplumber.org; dkim=none (message not signed) header.d=none; networkplumber.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a0cf9347-a3fe-43ef-8ee9-08d8f2ddbc11 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b5qQWIfHBO9dmtQvMy4jowQ3PnDsucHCALrwzPRBmz+ztFSq/NpBL4xYKnLoLu9mIE8tZkmynzOUsJNKy9aPuK72J5srqEgwCTia33uwBm/Kc55QaAEgYXbgQUNRqHsHOjm+D+4HNLN5Wzw1I3ttG7oIZsqRzaiWd+F5U82ZlXfcQGTjhLiqxchBjcsYes/HetT2uYcViQN47w1T4cIi7T4BcI9JxGNNc67/fjf4ajm7AGOd/GEoRtrGVcfNdW5UISFURea5Xs6TAgREB7sO2jaE32xVTYZx1wnAeVCua0WsSY/52B3R34+UJDMQPAR09/z0TYqBhXJneJCtMpMxnrf8ebJV39P3F1cGMnCNYcXXZ/N5CdLDjuOIgqQZ6+G7FURfITwNQPFaUzG2NPEYv4Kf+5OaB60SUYcbwjHvO1BS0Hv2G12lWAVDldutD+dCLmrrbYmhb4TUtZb6DC5NZCtDh2gmiBfxmWRlZcuya7xPcIV27fHJXy8U2UCKix4iBSyAOHHRuzWrkiBGbWHZq78bHxu3n2yuzPaJ8B5rHYLHCfB1rreUGKa2WKfr3Zhy5n00FmL6X38xtsa+J75+HK/eWK3G6JjoHAGBY2L+SJYQRh9B4FrItnmeGG4MfN3EllEf7hwUUmtqmpOZJVfN0IhRg2BgcCS3qAiSZ/tfu9woJPxm3pGTEly5d6QrlZ2iQ+jDbdU9ZKflCJSN26R0llS0oBuBoBhxvLAkeMR12n0= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(346002)(396003)(136003)(376002)(39860400002)(46966006)(36840700001)(966005)(6506007)(8936002)(54906003)(33656002)(26005)(36860700001)(82740400003)(82310400003)(2906002)(7696005)(336012)(83380400001)(4326008)(52536014)(55016002)(70206006)(8676002)(9686003)(70586007)(5660300002)(316002)(47076005)(186003)(6862004)(356005)(478600001)(81166007)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 18:09:16.0592 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bed8dd3f-fc68-4d48-ed73-08d8f2ddc3e7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3388 Subject: Re: [dpdk-dev] [PATCH v3] pflock: implementation of phase-fair reader writer locks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > > > > Subject: [PATCH v3] pflock: implementation of phase-fair reader > > > writer locks > > > > > > This is a new type of reader-writer lock that provides better > > > fairness guarantees which makes it better for typical DPDK applicatio= ns. > > > They lock internally uses two ticket pools, one for readers and one > > > for > > ^^^^ The > > > > > writers. > > > > > > Phase fair reader writer locks ensure that neither reader or writer > > > will be starved. Neither reader or writer are preferred, they > > > execute in alternating phases. All operations of the same time > > > (reader or writer) that try to acquire > > ^^^^ > > type > > > > > the lock are handled in FIFO order. Write operations are exclusive, > > > and multiple read operations can be run together (until a write arriv= es). > > > > > > A similar implementation is in Concurrency Kit package in FreeBSD. > > > For more information see: > > > "Reader-Writer Synchronization for Shared-Memory Multiprocessor > > > Real-Time Systems", > > > http://www.cs.unc.edu/~anderson/papers/ecrts09b.pdf > > > > > > Signed-off-by: Stephen Hemminger >=20 > Any more comments? Other than the typos in the commit log... There are additional comments in the code (in librte_eal/include/generic/rt= e_pflock.h), you need to scroll down as the test code is on the top. I did = not take a deeper look at the test code yet.