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 C0DACA0562; Wed, 14 Apr 2021 17:36:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4708C161B75; Wed, 14 Apr 2021 17:36:38 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 19D384013F for ; Wed, 14 Apr 2021 17:36:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618414596; 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: in-reply-to:in-reply-to:references:references; bh=3ZbX9tUeyFaOGMJhozBBVv1H4hNqWAHpIjD7UA9FUHE=; b=hPZMUKlYjZoQ4bmF0YokUdND0YFOqfr64xLFdJMdZDBJI69o1a/O19xnZ7ttK9atrB/wpy xzWbO1kDG/KwZ3XuTOhCP9J8H/rwZ98I1N3tP3SCNg0abNpdHBMsTuaTds8z0NHy56eXNh knK7eUratJTdXjGmYPLAEkBxWt1VfC0= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-300-xxN-0g9wPXSZ2u3hw7Cvag-1; Wed, 14 Apr 2021 11:36:33 -0400 X-MC-Unique: xxN-0g9wPXSZ2u3hw7Cvag-1 Received: by mail-ua1-f72.google.com with SMTP id b7-20020ab06e870000b02901d493c3b90eso711014uav.7 for ; Wed, 14 Apr 2021 08:36:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3ZbX9tUeyFaOGMJhozBBVv1H4hNqWAHpIjD7UA9FUHE=; b=sqJ87/VynCnO4Ywheiv9Js2sRt0op1SBFGa43WOGCLyMmOz90xmKbe2J+JczbQqNnL Hf8hynLUW1P07sVPgoQ/qybeQMr5b+4gV/BRddcySkOP68iqI7HsCQKuSbbcxSt1C88N 1Vn1i1mqwalADVCphIHGj5vGeT4OMKv5JICOPck5Bww2r1YsZ7NZE66QRSsg7dWPO24w 6jVgVK4MPI902ST3k5b1m+A1qENEZhhfGeeAqNYgq+K6gU390lc/rJqzuQHFSDwaEQw0 8EpjLcv8ISxvWZ9saeiELZG2zaRXfJYQAT1NsWTTxqLf2wws/ILMP5d+Af7URU7TLPZ7 MHUg== X-Gm-Message-State: AOAM531d19nrE7iVPy6Ida2M+gjiUOGflLLQ/HLJg4chh4xNsBmhdyY3 X1kMyc8iqpxwtU5FH9BfSq2RqfgZMbUg1nBsLjeaXtyaok/ppXx8m8rjy8QKdKZMLLQtFxgJGYA UvEU6D8Yszx8l8aKSvLs= X-Received: by 2002:a67:de08:: with SMTP id q8mr11105222vsk.5.1618414593257; Wed, 14 Apr 2021 08:36:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAPfRpj9cHjdLtp3zLr1U8Z7ddwGDkC6387ytYk/8QxSQ8dpvfc/8opcSQL2AZEhj0BDnHmpk48ItBPGakTas= X-Received: by 2002:a67:de08:: with SMTP id q8mr11105192vsk.5.1618414593033; Wed, 14 Apr 2021 08:36:33 -0700 (PDT) MIME-Version: 1.0 References: <20210212013838.312623-1-sthemmin@microsoft.com> <20210402014247.196702-1-stephen@networkplumber.org> In-Reply-To: From: David Marchand Date: Wed, 14 Apr 2021 17:36:21 +0200 Message-ID: To: Stephen Hemminger Cc: "dev@dpdk.org" , Honnappa Nagarahalli , "Ananyev, Konstantin" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5] 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" On Wed, Apr 7, 2021 at 5:10 PM Ananyev, Konstantin 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 Acked-by: Honnappa Nagarahalli > Acked-by: Konstantin Ananyev I added a short release note update. I chose "phase-fair" as the unique way to identify this new API. I updated the patch with this for consistency. I put this new API under the EAL common code section in MAINTAINERS. A comparison on when/why to prefer this over the existing locks would be helpful in the developer guide. There is also a question from Honnappa about test validation. Can you follow up on those two points? Applied, thanks. -- David Marchand