From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 37A313959C86 for ; Wed, 16 Nov 2022 10:52:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 37A313959C86 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668595932; 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=eLFN6s6EvHveqhAaRt9IS0K2R/kVoI3Vj05LPlEvW+U=; b=IeYjzx8q/n5OmPe2s1O+ImkqhVEWiAJjU+PuIMgNEt7szE+Xkbn2z2ynDaT7aD6bS80s8g EK+11CopYaUAtRsYzbaQLGKP6x+vqbaQLHyQkUnNSfFF/RAeCkpwMhJ2q1bjKGFO1u3LQn q5BhCvHQajW/mQhShZ6lWQEz3geG2fs= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-623-LGKs6vUCOt2ysKgDfzbfxw-1; Wed, 16 Nov 2022 05:52:11 -0500 X-MC-Unique: LGKs6vUCOt2ysKgDfzbfxw-1 Received: by mail-ej1-f71.google.com with SMTP id hp16-20020a1709073e1000b007adf5a83df7so9526383ejc.1 for ; Wed, 16 Nov 2022 02:52:11 -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=eLFN6s6EvHveqhAaRt9IS0K2R/kVoI3Vj05LPlEvW+U=; b=14CdzlvcdbdXQGeWQxKJr66sWEl+uHvjweJLzQjqqHVhauSqdC6/X+rNxq0x0H5SAb WK0xcI3TAcduKnd2FqSdg9F8WluZqbGJs6MUmHP/zKYvAkQqEulWbx7+udQr/KkjC6M4 cRFftOB3DZEHJaskXFK9jfGdJBbpnACmr1gnL56vh4yXbiAjQMp+GWe/Ifa3GZhWt9WK s6eVehl8Kq2UcQ8dmqXEFrCwJ+GSSrw5fIBxa/mz1pLp0TmoUst1rs5x2wPsJUo5gA6k gPK8soFNsZNlXTGVoHQkdAAF6O1tCROTrFuw58jXdhvDS1mpGMCkQ9gcL/WAX3nSaXnl isDQ== X-Gm-Message-State: ANoB5pkO5pXF4ne/aSTHpAvBcWD/O5uTZOET+hQFYuum99BVROUncixK IyeWPdm3fh5U62r7y6OmB3dDgE6pKB95Q7RDzXtGPhKIrZcSOqWXoefjbl1sOXm+7Yje/7Ksowb RA/8FRU5UXe1m1Zz8y1JVzdo7Wg5PDZrSGw== X-Received: by 2002:a05:6402:d78:b0:468:816f:bbc9 with SMTP id ec56-20020a0564020d7800b00468816fbbc9mr2153420edb.78.1668595930106; Wed, 16 Nov 2022 02:52:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fxnZ/VXHwUe3/Z/KQOVFKMiO96oI1PAsNah/rXOS+aOso1TGrdLZszsNvD/sAe92KTbuldJ1yYtTXFE4FhmA= X-Received: by 2002:a05:6402:d78:b0:468:816f:bbc9 with SMTP id ec56-20020a0564020d7800b00468816fbbc9mr2153399edb.78.1668595929905; Wed, 16 Nov 2022 02:52:09 -0800 (PST) MIME-Version: 1.0 References: <20221115033559.66827-1-hongyu.wang@intel.com> <9289c261-6aeb-2fdf-6599-4e8d77c30f8@ispras.ru> <7a41f182-1638-1a70-c0dc-b90b1985c31@ispras.ru> <36b75ee4-5f97-16ab-8d9d-a060e996b5da@ispras.ru> In-Reply-To: <36b75ee4-5f97-16ab-8d9d-a060e996b5da@ispras.ru> From: Jonathan Wakely Date: Wed, 16 Nov 2022 10:51:59 +0000 Message-ID: Subject: Re: [PATCH] doc: Reword the description of -mrelax-cmpxchg-loop [PR 107676] To: Alexander Monakov Cc: Hongyu Wang , Hongyu Wang , gcc-patches@gcc.gnu.org, hongtao.liu@intel.com, ubizjak@gmail.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 16 Nov 2022 at 07:51, Alexander Monakov wrote: > > > On Wed, 16 Nov 2022, Hongyu Wang wrote: > > > > When emitting a compare-and-swap loop for @ref{__sync Builtins} > > > and @ref{__atomic Builtins} lacking a native instruction, optimize > > > for the highly contended case by issuing an atomic load before the > > > @code{CMPXCHG} instruction, and using the @code{PAUSE} instruction > > > to save CPU power when restarting the loop. > > > > Thanks for the correction, it looks quite clear now! Here is the > > updated patch, ok for trunk? > > Please use 'git commit --author' to indicate authorship of the patch > (or simply let me push it once approved). > > Jonathan, please let us know if the above wording looks fine to you? > Mainly I'm asking if '... and using' or '... and use' is easier to read. Your wording above ("and using...") looks good, it reads naturally and clearly. It's quite a long sentence, so I considered suggesting: "... by issuing an atomic load before the CMPXCHG instruction. Also use the PAUSE instruction to save CPU power when restarting the loop." But I think your original is better. The sentence is long, but it flows better as a single sentence. As two sentences, the second one just seems tacked onto the end and it's less clear how it relates to the first.