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 848BEA034F; Tue, 30 Mar 2021 07:14:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33791140FA9; Tue, 30 Mar 2021 07:14:47 +0200 (CEST) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id C1E7D140FA8 for ; Tue, 30 Mar 2021 07:14:45 +0200 (CEST) Received: by mail-pj1-f44.google.com with SMTP id a22-20020a17090aa516b02900c1215e9b33so8826579pjq.5 for ; Mon, 29 Mar 2021 22:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Oc/9y1dgwjMlTBXoG7HMYcIE0/Q6l4OOz+PFad8Vfpo=; b=YMWwXleD63M6zP85ThsseRWE3B8zt0Vd4uzxWaXeEYyGYt4M0nW0IHcz2qV8+xlbJP iyLYJhBmnTZwSGq8sYZi/KIFv0P702vT2v75gc1szN1W4FeCPdgdkOV2Oas48lEX1GHd Ja1eg04Hk3deAtrHBGlTVjdAVHpqblUG++jAL/XXng8Ahay/Sq68aIG9k/d2enfTM1x7 gQ4KjoeFqpeoepfdftK5P2yL2e3MmHm7zCzPEzsgPnyEueZBypk2atVmkzC6D2M3cfBM m0K9RGVlGUm2G0RfCfnACWebPu9XHeeNW3le35JwkC1q2rxOGyhaxc0yVRW6Glg3yfat vv9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Oc/9y1dgwjMlTBXoG7HMYcIE0/Q6l4OOz+PFad8Vfpo=; b=YXkCeJyZv7h/GdB5tnwCm3EF/2MMjowcbt7hC2vq7gU5hHw7lPXzNNmkultaH+Feq7 vg64HJ10Zx5ybKGiVYvnL8A91dbZMWssE7qQT7GbrhFNuUro9sex03AG95QDMcgLZb7w RqDgz6GaFRojMSf2DiCisyLSdBeY3x68PF9hl0n6haVAa2MYTU4lrI7unRm23u+vk2t6 VD9c2KzSxl41/cYk1ZR1Z3w7WXGh01MrNKB1wADyf0e8qal2uy+kbbckAa81N00LQBrL OI2yDnGX7H8zmpmrteCijzcpu55sErE7XByiPcmMGcbS2rOENjVtjqT3KGcl45KdR4sZ KkjA== X-Gm-Message-State: AOAM530Y06rokssjN1C36xmgscuFBRGTmUuyhyFLdc+/qSLJ6u4zKKyt B4JcgyUAhGXDhY7WgDUO47qEJA== X-Google-Smtp-Source: ABdhPJyG1Fk44NxNLKg71EkTs6jZ35kLOKNJTX1nkoLjFgWX+5iymUmRaot9ahlBnOhq/tTVhvjzTw== X-Received: by 2002:a17:902:f545:b029:e7:1d03:65d4 with SMTP id h5-20020a170902f545b02900e71d0365d4mr21946662plf.38.1617081284113; Mon, 29 Mar 2021 22:14:44 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id n22sm3009701pgf.42.2021.03.29.22.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 22:14:43 -0700 (PDT) Date: Mon, 29 Mar 2021 22:14:30 -0700 From: Stephen Hemminger To: Honnappa.Nagarahalli@arm.com Cc: dev@dpdk.org Message-ID: <20210329221430.410f030a@hermes.local> In-Reply-To: <20210330050047.34175-1-stephen@networkplumber.org> References: <20210212013838.312623-1-sthemmin@microsoft.com> <20210330050047.34175-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4] pflock: add 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" On Mon, 29 Mar 2021 22:00:47 -0700 Stephen Hemminger wrote: > This is a new type of reader-writer lock that provides better fairness > guarantees which better suited for typical DPDK applications. > A pflock has two ticket pools, one for readers and one > for writers. > > Phase fair reader writer locks ensure that neither reader nor writer will be > starved. Neither reader or writer are preferred, they execute in > alternating phases. All operations of the same type (reader or writer) > that acquire the lock are handled in FIFO order. Write > operations are exclusive, and multiple read operations can be run > together (until a write arrives). > > 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 v4 incorporates feedback, adds some comments and drops the trylock for now.