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 6975741C49; Thu, 9 Feb 2023 09:08:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4EBB740DF8; Thu, 9 Feb 2023 09:08:38 +0100 (CET) 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 7C5F04067B for ; Thu, 9 Feb 2023 09:08:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675930116; 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=vJd6E++xIDZxAhWrmKGUyvYKaV8PjE4xcP66atwa2y4=; b=P4t15AeBLE5WNQzLinbiXoeBQ7SsryHifwZXXxOT0pWqil5y3i1PlG6oA/DrC2rj92ZDEj Q02OMZNVQGwO+Dm6p0RQ3/Y48tgeQSMnoGuwuwG0ljmyj+lx66a7ux008BrOnXeYB8XOeh HDpJIyuxM+ddSxcxgGJdLK7MgSbm64w= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-458-VBzolBCIN-6-zpqhRmQt7g-1; Thu, 09 Feb 2023 03:08:34 -0500 X-MC-Unique: VBzolBCIN-6-zpqhRmQt7g-1 Received: by mail-pg1-f197.google.com with SMTP id s76-20020a632c4f000000b0049ceb0f185eso785357pgs.7 for ; Thu, 09 Feb 2023 00:08:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vJd6E++xIDZxAhWrmKGUyvYKaV8PjE4xcP66atwa2y4=; b=hiUvWA4ez2jLQowmGBUYd9rvTLq0OX1dsjvNXMqwvvya6syIMdH8DnRjwW15b5XTyb FOWhJ+DS8WWrz7pvtgI6Z9erxQwaFnq10D/QRLvPL4USfBrxdE40GmnnjG1QY9xcaZpF sFv+38q/uMSSWpkNrepIOGHbKitALDtWKWslV8dEShJ9hHRbat3Hlo+Qg1hSWf5QRTMU zxzWa3onToymugy1HuAuDVO0xP82M/HLcXrc94038Ow1GjZuexL8y0bVXOsXaoGA9XFa szSqpAGjynzj6qLWiV/8hXtp7hZOJwkFKXyRmodljKE3w6X2nANKfXKt3NuPOCpu7TkQ 5EKQ== X-Gm-Message-State: AO0yUKVDSpnEbF3xtvDgP+95OC/ZWx9tx/nTVYLNc+FIsEHGvMKPr/0v cQcQiCR3q8dDqEvpITMyGAxMab15wysUfnt9qLLnwIMDFAZ3Yu6raUvS7z1D+V5eMAKmP/azhjz SKpVIUaiihezwi0j6TOo= X-Received: by 2002:a17:90a:ce8f:b0:230:89b2:fabd with SMTP id g15-20020a17090ace8f00b0023089b2fabdmr1330004pju.116.1675930113746; Thu, 09 Feb 2023 00:08:33 -0800 (PST) X-Google-Smtp-Source: AK7set8/KJIvB295Rbv4fTOFF7QR/+M4EZaWm4tNqM7I9lx8G52jPMBxvV+L19Oy/oMFfsFUMgmDFbjDEI3G27TAgC8= X-Received: by 2002:a17:90a:ce8f:b0:230:89b2:fabd with SMTP id g15-20020a17090ace8f00b0023089b2fabdmr1329997pju.116.1675930113389; Thu, 09 Feb 2023 00:08:33 -0800 (PST) MIME-Version: 1.0 References: <20220328121758.26632-1-david.marchand@redhat.com> <20230207104532.2370869-1-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Thu, 9 Feb 2023 09:08:22 +0100 Message-ID: Subject: Re: [PATCH v6 0/9] Lock annotations To: "Xia, Chenbo" Cc: "dev@dpdk.org" , "maxime.coquelin@redhat.com" , "stephen@networkplumber.org" , "Hu, Jiayu" , "Wang, YuanX" , "Ding, Xuan" , "mb@smartsharesystems.com" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Hello, On Thu, Feb 9, 2023 at 8:59 AM Xia, Chenbo wrote: > > Subject: [PATCH v6 0/9] Lock annotations > > > > vhost internals involves multiple locks to protect data access by > > multiple threads. > > > > This series uses clang thread safety checks [1] to catch issues during > > compilation: EAL spinlock, seqlock and rwlock are annotated and vhost > > code is instrumented so that clang can statically check correctness. > > > > Those annotations are quite heavy to maintain because the full path of > > code must be annotated (as can be seen in the vhost datapath code), > > but I think it is worth using. > > > > This has been tested against the whole tree and some fixes are already > > flying on the mailing list (see [2] for a list). > > > > If this first series is merged, I will prepare a followup series for EAL > > and other libraries. > > > > > > 1: https://clang.llvm.org/docs/ThreadSafetyAnalysis.html > > 2: > > https://patchwork.dpdk.org/bundle/dmarchand/lock_fixes/?state=*&archive=bo > > th > > > > -- > > David Marchand > > > > Changes since v5: > > - rebased after lib/vhost updates (patches 5 and 7), > > > > Changes since v4: > > - masked annotations from Doxygen as it seems confused with some > > constructs, > > - fixed typos, > > [snip] > > > > > > David Marchand (9): > > eal: annotate spinlock, rwlock and seqlock > > vhost: simplify need reply handling > > vhost: terminate when access lock is not taken > > vhost: annotate virtqueue access lock > > vhost: annotate async accesses > > vhost: always take IOTLB lock > > vhost: annotate IOTLB lock > > vhost: annotate vDPA device list accesses > > vhost: enable lock check > > > > doc/api/doxy-api.conf.in | 11 ++ > > .../prog_guide/env_abstraction_layer.rst | 24 ++++ > > doc/guides/rel_notes/release_23_03.rst | 5 + > > drivers/meson.build | 5 + > > lib/eal/include/generic/rte_rwlock.h | 27 +++- > > lib/eal/include/generic/rte_spinlock.h | 31 +++-- > > lib/eal/include/meson.build | 1 + > > lib/eal/include/rte_lock_annotations.h | 73 ++++++++++ > > lib/eal/include/rte_seqlock.h | 2 + > > lib/eal/ppc/include/rte_spinlock.h | 3 + > > lib/eal/x86/include/rte_rwlock.h | 4 + > > lib/eal/x86/include/rte_spinlock.h | 9 ++ > > lib/meson.build | 5 + > > lib/vhost/iotlb.h | 4 + > > lib/vhost/meson.build | 2 + > > lib/vhost/vdpa.c | 20 +-- > > lib/vhost/vhost.c | 38 ++--- > > lib/vhost/vhost.h | 34 ++++- > > lib/vhost/vhost_crypto.c | 8 ++ > > lib/vhost/vhost_user.c | 131 ++++++++---------- > > lib/vhost/virtio_net.c | 118 ++++++++++++---- > > 21 files changed, 405 insertions(+), 150 deletions(-) > > create mode 100644 lib/eal/include/rte_lock_annotations.h > > > > -- > > 2.39.1 > > Seems one compilation error reported? Not sure it's related or not. We discovered recently that Intel CI filters out doc/ updates in patches (?!). https://inbox.dpdk.org/dev/20220328121758.26632-1-david.marchand@redhat.com/T/#mb42fa6342204dd01c923339ec0b1587bc0b5ac0a So yes, it is "related" to the series, but you can ignore Intel CI report because the reported issue is fixed since the v4 revision. Btw, thanks for the review Chenbo! -- David Marchand