Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp620091pxu; Tue, 1 Dec 2020 21:58:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyITA+D0OjuWFykpha3kvw+miDmCz+q7qKdceR3/N1DYFGUqtAh9rWsWg+q4M4QGuZYUy8f X-Received: by 2002:a17:906:6987:: with SMTP id i7mr857682ejr.18.1606888726109; Tue, 01 Dec 2020 21:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606888726; cv=none; d=google.com; s=arc-20160816; b=M5qoIBEQt6fQiuovLNr76XHjYFLIF866kJ6Nxl4baP2jLoNAp+Y18CZ2WhUlpGoAtR I0K3mRZxuy6ZPu4QjQMQBSuPqi64KHKrML/bIj9ewxipqUPXIX7dp1nLZYiAFMY6Z5WV i0JrQcVxKmzo21k89fMgWS1uiYzMbV7uwhYbYsOLd609eMmP+3ulMNtMCRujROVnRe61 Dfs7jQjX1elRKtmN5HonmFA8ntGNIrLzQ1FNshCDZIpwXsEU7BRlyovgDXfaBLLYCbA7 DadDH+L+cHOSG7oa975Dl2GAN+LzlmEMa/F4wkdwIVAutpE/SG3yN+71eUuu2T9emBfM BezQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kF4MPMV0LOJFs58rVTILZsCl7WhPqj7BoWapl4MSIas=; b=m0ZAbBnJT4E1hj7VLZe8sFaq2N8pphQvRQSqob1bmgwi3rBM1RfrjQMy0b+g6Fyf1F TVhA6n+aC+QOROJ8CE2hfp6HzDBhTMt4HVe5MjikZWTHprNRh2+SmmNyOCkHpQuYmgSg cyKgTdwsbzquuZR1nh93nTlnRx1uExx1ykbGxECBo2meG23o+3WtAD4LyG2/aVa/mJHL UH8Ia5EN1rhqfF3Lw87PsvH1nk3e7jcumXQjKMFzZxi3vf8mAz47jiGIXg6RT+uOwlIA iZZNu+3//Rr5EplWv2gRRzxBiR/e0JDe0Uielq9fU2xw65NTNJ5Apd9Dml5AE71PlfJx F+7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LIKmg7gO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay25si431820edb.8.2020.12.01.21.58.21; Tue, 01 Dec 2020 21:58:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LIKmg7gO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbgLBF4P (ORCPT + 99 others); Wed, 2 Dec 2020 00:56:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725979AbgLBF4P (ORCPT ); Wed, 2 Dec 2020 00:56:15 -0500 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED278C0613CF; Tue, 1 Dec 2020 21:55:34 -0800 (PST) Received: by mail-lj1-x244.google.com with SMTP id o24so1325474ljj.6; Tue, 01 Dec 2020 21:55:34 -0800 (PST) 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=kF4MPMV0LOJFs58rVTILZsCl7WhPqj7BoWapl4MSIas=; b=LIKmg7gOf5TQqHOFN6bHxs0M12fOa+pXJ7zQlWfL1sTD+bnafY7ILuk7noKX8yem7/ rcBma/TUWGFd38s0xp5T6sq+WmqxI/P3niWjVmTWKF49OfkRt7194nK/OzvKzRr/Ytzv bVV9OY86nwVPyvmU755Sj0i/yrGjerUGNAYCa0U/o8PW/HQLIe3Ihq+UsVw6myrstixc rzm2LkDj3hY36Io9HMyIjCvK7ElEap6qtqDuoJ7AjiL8X8DMkpPxUaPZatOySfWAnyjh 0CxCkTnCtdjFBaXYcQNZ8SjGNmkfc7cYZi+UoqW6cAiGNPLqgjzRLBdCUYUlEj0Hs5bt 9Erw== 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=kF4MPMV0LOJFs58rVTILZsCl7WhPqj7BoWapl4MSIas=; b=PV8SCHKH1KGP+AM7a7x9fgC15sn7o7Jys0Zip690qnYJgcmon++3+SX2yy9wP8PbhN xDOR/jbEp1Sog0m1cIgwBNQZ7jZvl0gPkmTg2swWheG3vMzshh9reH+5ARfOi8fd4vF7 1lsGJ9ZSFZTNMOfbK9W0PY5NskFF5VlLNoMnUlCxbknvkKAlRwWV7974h3PAJWGLDaG8 9Vwi8rShk6mAxepQ7egHp5++32t10FQDHY0KXH/JGMgzcclKmT+PPNKtwUtusSHMtdOn 0s3IXFTZuPTy80+yi5efE6AiLoFKaCl1iF2JxT/kvh0TH20i8z8QGZEs6m8kS8CH64Kc mH7w== X-Gm-Message-State: AOAM533oKsfonBlmwhzdW2HuO33m2OIRj0bVmtJYMzDWI0l9Q9hyNbHc wSwC1XDf2iqFf2tC1L+va1qyhdU3GmPHHCwv2UI= X-Received: by 2002:a2e:8982:: with SMTP id c2mr455784lji.121.1606888533502; Tue, 01 Dec 2020 21:55:33 -0800 (PST) MIME-Version: 1.0 References: <20201127175738.1085417-1-jackmanb@google.com> <20201127175738.1085417-11-jackmanb@google.com> <0fd52966-24b2-c50c-4f23-93428d8993c4@fb.com> <20201129013420.yi7ehnseawm5hsb7@ast-mbp> <1dfd2e5e-f8d2-eac2-d6b2-7428ceb00c36@fb.com> <20201201123800.GG2114905@google.com> In-Reply-To: <20201201123800.GG2114905@google.com> From: Alexei Starovoitov Date: Tue, 1 Dec 2020 21:55:22 -0800 Message-ID: Subject: Re: [PATCH v2 bpf-next 10/13] bpf: Add instructions for atomic[64]_[fetch_]sub To: Brendan Jackman Cc: Yonghong Song , bpf , Alexei Starovoitov , Daniel Borkmann , KP Singh , Florent Revest , LKML , Jann Horn Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2020 at 4:38 AM Brendan Jackman wrote: > > I guess it's also worth remembering other archs might have an atomic > subtract. which one? arm64 LSE implements atomic_fetch_sub as neg+ldadd. imo x64 and arm64 example outweighs choices by other archs if there are such. Even without LSE it will be neg+llsc loop. The reason I proposed bpf xsub insn earlier is that I thought that llvm won't be able to emit it so easily and JIT/verifier would struggle.