From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBB23C433DF for ; Sat, 27 Jun 2020 15:39:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A46FD208B6 for ; Sat, 27 Jun 2020 15:39:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JB5WliBp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725882AbgF0Pjw (ORCPT ); Sat, 27 Jun 2020 11:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgF0Pjw (ORCPT ); Sat, 27 Jun 2020 11:39:52 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6413C061794 for ; Sat, 27 Jun 2020 08:39:51 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id c4so12892020iot.4 for ; Sat, 27 Jun 2020 08:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KzYOQk32aMBSnUMNZrbsAt304k4F4/lr09tt6MftDnA=; b=JB5WliBpGEfFQysnuA09/xC40bj++bX22gBwfX15/mUjInVE+FPThH8MDU57KV3Kgk v4NEFL6MpXVe2xjw8rGdrhEjMbeHBWQv66Veh/qLRvrf8zWfrTLQNPyk/2W3rNN1creh nyznALirqiS3kDnRkukc3uyuJ1XO4gTG8gpxUGvfMw4/fP5k2F3mhgX9ezGsb7z2hd9D 2NIDnmqD5MHcigwbKpf6xhrk2Ax9UetkP58aJQIJEs1atdyGVihGSLfFEDeONoRYr8Vv mzjwvBvCR5qePz0sR1IRG0YSWAjV/Vp8PaHW21ZsqrPyYVpeYcAt4UYN0EVXljbSmWMA qMCw== 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=KzYOQk32aMBSnUMNZrbsAt304k4F4/lr09tt6MftDnA=; b=SJqVcdeLyqE1hY6MjwBbaAlqHSETvVgfediUwy/P0skP1VUsUDOHvbbMQ0xh0mAE6f kUwCfSV69OfWrb1ERh+nHrewwgZ62gxRqBG4m3l1TfydAvy/o4wjx0cDlTllwMoZSQCi pQlEgLyMnviLMrCm5BsJ8ZIY4vSXyrvEKaJanWfaeVBEgjvPOoC/oYQMcGANFiBTI/or 3RJCohasEk3qX33j+tR4CEJR3HV/hJQ2G36x9otSgbOyHPCGVJYsx39rK75j/PS2JA9q ifAPwi7gRyHqc63lBCmi9sS2aYP0i6ncx9oD2R5Y8PVdWggvvWEqWkWe+yroBUnDuxsg e8Og== X-Gm-Message-State: AOAM533YdhClRk3rtUiF02I+IHIkcx9hW1ZL6E5jETsFFr0IPns67Jpu /XFciO6CtRi3m9KIldPwLwR/Qqps3xqE/fZmWqo= X-Google-Smtp-Source: ABdhPJywGTUo8cYiV5Dz2XGsLiNimikK+yaMed4Kmeq1h4SaBq4NZRtK706+uql0q+atL7IVm1c/LWUhHG+Uc5DsIjo= X-Received: by 2002:a6b:bec7:: with SMTP id o190mr9016969iof.44.1593272391146; Sat, 27 Jun 2020 08:39:51 -0700 (PDT) MIME-Version: 1.0 References: <20200627055515.764165-1-zeba.hrvoje@gmail.com> In-Reply-To: From: Hrvoje Zeba Date: Sat, 27 Jun 2020 11:39:40 -0400 Message-ID: Subject: Re: [RFC PATCH] Fix usage of stdatomic.h for C++ compilers To: Bart Van Assche Cc: io-uring@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Sat, Jun 27, 2020 at 11:27 AM Bart Van Assche wrote: > > On 2020-06-26 22:55, Hrvoje Zeba wrote: > > Since b9c0bf79aa8, liburing.h doesn't compile with C++ compilers. C++ > > provides it's own interface and can't be used. This > > is a minimal change to use variants where needed. > > I was not aware that liburing supports C++ compilers? > Why is this there then? https://git.kernel.dk/cgit/liburing/tree/src/include/liburing.h#n6 > > struct io_uring_cq { > > - unsigned *khead; > > - unsigned *ktail; > > + atomic_uint *khead; > > + atomic_uint *ktail; > > I think this is the wrong way to make liburing again compatible with > C++ compilers. Changing these data types causes all dereferences of > these pointers to be translated by the compiler into sequentially > consistent atomic instructions. I expect this patch to have a > negative impact on the performance of liburing. > Any suggestions?