From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 175AE3858C27; Tue, 3 Aug 2021 20:59:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 175AE3858C27 Received: by mail-wr1-x433.google.com with SMTP id m12so21890642wru.12; Tue, 03 Aug 2021 13:59:55 -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=FLk/2RjWAmdiehNGDZ5X7T+c59CDWhnWs4dbWwHvlAg=; b=PC2CvnHfCZNwFSmIU5YbPEEoHpavNwK5y9cy1PvkFyhAE8gwANNxfiSBYlFzcfaGdb wqjVHhXQAap04XWAA9NDk0sMbbZSw1yYasIcYzZDZ8epq2oMF7QoLeEPyK7wuM6hQfnk X6cBdm55ckAffhYsH90T6RgFrH+pLgqDialahJRdguSy+UOXjNu1sPJVR3mtz3vogOqu dnctPV5cbz1ng+52eQlkKTxwGtpGFBx6CTa9Uy4OTP/rvN9szapRaaEoETFlLQ3LSmtz XuUDQ0nMwKh+tzmkSEPIhienD1n++h8/qo3GsfUOF7OPi5qnU8XcOygp6cByHoPQceKW WdNQ== X-Gm-Message-State: AOAM5319YY7OQT2FV8wWa2r6s0JRcI3kwp+wbjDaqk9nqH838nA3Vzr8 LNVX3vn57OYVkZuVl+UFZuN/duk7yZot92qz3dY= X-Google-Smtp-Source: ABdhPJxo6pBdzGenVXYNdBdmISai9SwEtwEfGvqV2gr59M5bmXeibxTM6MEJFN7GWNFRXFmYr1N/SI/VKT7PR/PR0GQ= X-Received: by 2002:a5d:5090:: with SMTP id a16mr14317534wrt.21.1628024394093; Tue, 03 Aug 2021 13:59:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 3 Aug 2021 21:59:43 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1 To: Maged Michael Cc: "libstdc++" , gcc-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 20:59:56 -0000 On Mon, 2 Aug 2021 at 14:29, Maged Michael wrote: > > This is the right patch. The previous one is missing noexcept. Sorry. > > > On Mon, Aug 2, 2021 at 9:23 AM Maged Michael wrote: >> >> Please find attached an updated patch after incorporating Jonathan's suggestions. >> >> Changes from the last patch include: >> - Add a TSAN macro to bits/c++config. >> - Use separate constexpr bool-s for the conditions for lock-freedom, double-width and alignment. >> - Move the code in the optimized path to a separate function _M_release_double_width_cas. Thanks for the updated patch. At a quick glance it looks great. I'll apply it locally and test it tomorrow.