Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp723891pxa; Wed, 12 Aug 2020 11:50:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK8n5bRK+CJJH6Ai0WSsdLEMFNEj7eakI3Ost1j91ZG6X5eu9q5hVXT+Nfoxa4S7XdRBzz X-Received: by 2002:a17:906:a019:: with SMTP id p25mr1199502ejy.463.1597258231829; Wed, 12 Aug 2020 11:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597258231; cv=none; d=google.com; s=arc-20160816; b=Qv9eJjH9OLA5ILGdMLvMIUEQOgGjY4FtYu3eB6nlAgidjodLxVArJjZYC6r49+jtPL h+0ezwkg4q4BJEvYfUfgLiJP+HRehueZ62pIXqL5msxBnThr7qKIBzt6mkNCIPbhUSjV 4kx2Zn10x/9uBk1+yIxELfn5Okn7r3KPosCTrncFY0O3jm+5D4HZcDAG32USwRlK6LLh EU8/SYxh1ezXS+qsL/Va46bL87EiJ9qKcMCK2MQ7M3HJAPPMiL4CB6jcXDzX1nBg4ch0 xXeuRj3jCm3OSWl0ZkQkkWsHQw5aNcQNPhiRmtyVK0j8c8HBIb4e6txDzsIHALvBzKxU UqsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yBO/pnEHQ4hT1uxwOQx8Qyul82lB7+FBvNPMRSuDsMc=; b=nNyFX6T1XcgdugwvGcZRm/ml3exs9sfb0MrhBmGf7BtGHKj9nhOErmFnJbNh9kIcY0 9ifux4dGJL6hgPoQujhqPjN84ylW+V8VWIG1jw+IuwWH9ub0wQCQSldS5EXhgE0drWuN yBKyro5kQjICa3/X8VvNIqkaAAvKFbpGKX80EfFIt8i69ilSY6o222nSzJ5iTMiJNkkL /vkaDdzwxUkBpang1fzqTfstyToU+dO2uwCKmyghiBpQijrNHFDSGTq6od10iUnpfdXu /FXynOX5LsFf0qz5qga++5j6j+JhNzD67UigORyFHwwekJdD4pjFTa6jSbXyBW2CcRBn kHwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=V71ytWat; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si2300343edd.551.2020.08.12.11.50.06; Wed, 12 Aug 2020 11:50:31 -0700 (PDT) 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=@posk.io header.s=google header.b=V71ytWat; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726583AbgHLStB (ORCPT + 99 others); Wed, 12 Aug 2020 14:49:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgHLStA (ORCPT ); Wed, 12 Aug 2020 14:49:00 -0400 Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D70C061383 for ; Wed, 12 Aug 2020 11:49:00 -0700 (PDT) Received: by mail-ua1-x942.google.com with SMTP id g20so910939uan.7 for ; Wed, 12 Aug 2020 11:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posk.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yBO/pnEHQ4hT1uxwOQx8Qyul82lB7+FBvNPMRSuDsMc=; b=V71ytWati3npYzKkoAcduUnnApyd+6kA1oXsO+L51h8l5zAG2zjTsiM8TDAU9T8sTs 12IbLK2P+X0JeHDb3kEHzbi/y6DcWUNEjm/eIeKkpki1axcUvEtUeAGaBVyqkpnS8bui vLHitqGsJNM5RK6kbYAWp3jyx/DDsgrwHDuBnGItHZ9bKhMuwA0qxOpx7rQry7ZrBjRh JRmVNx7QjndxRZqMV6gaJSmxsgoSAkmqXl2vzD6fm/+tjtKIg7YV+xYVUt2spuNnBP+f g4wSslut9AoBDqRRL5rLPa7IDj1+BI6jvQpEpmT64LCehqltfCnupGlyHETUpA9GEcbC hs+Q== 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=yBO/pnEHQ4hT1uxwOQx8Qyul82lB7+FBvNPMRSuDsMc=; b=OOPyl1SjQzI6vqcXSdE0VsAEpBWYPpSpUb5VTCZgbTxWGBJRvf1I7Igxm+XDcCqWNa ojecUsUO39UYwnUq/p9cKB1aRC2+ywU4iEDK99z+3lfINcK+nqNvpS6hWNmIiD9ttqwr S+Qb8kS2cvIKd+YhjrHoCxNr2MXSGeHo7LIC1oZK+6zmTxWdp5/gnHzcIF+p6Tfhz9lm 7OfTY24V8o8eZ1qfqdKg1lkTu9GT2vKklXbI6w077zmRJt6XksEA0LU6vxr1QJgUeSsC UNXkPWl6cOF0Jb8dTw+DqnmtYpmt3PaWiINKjMdO7bywimWmUet09RtoUKt5p+PelFdl OqCA== X-Gm-Message-State: AOAM5308LJqG81TFs3a0Q8IlWR3uv2aKdTJvv0qjUOoPZoYluVcdouqq FBGfLJk7+AcngPnMHH8X3im5ZunT4q5y2QTZwigiYg== X-Received: by 2002:ab0:4d69:: with SMTP id k41mr564373uag.131.1597258139845; Wed, 12 Aug 2020 11:48:59 -0700 (PDT) MIME-Version: 1.0 References: <20200811000959.2486636-1-posk@google.com> <20200811062733.GP3982@worktop.programming.kicks-ass.net> <1003774683.6088.1597257002027.JavaMail.zimbra@efficios.com> In-Reply-To: <1003774683.6088.1597257002027.JavaMail.zimbra@efficios.com> From: Peter Oskolkov Date: Wed, 12 Aug 2020 11:48:49 -0700 Message-ID: Subject: Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ To: Mathieu Desnoyers Cc: Peter Zijlstra , Peter Oskolkov , paulmck , Boqun Feng , linux-kernel , Paul Turner , Chris Kennelly Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 12, 2020 at 11:30 AM Mathieu Desnoyers wrote: [...] > "flags" is there to allow extensibility without requiring to add new > membarrier commands for every change. Even though it is not used now, > I don't think re-purposing it is a good idea. What is wrong with just > adding an additional "cpu" parameter to the system call ? Can we do that? I thought adding an additional parameter means adding another syscall (ABI => parameter types/count cannot change?) > A "flags" parameter is very common for system calls. I don't see why > we should change its name, especially given it is already exposed and > documented as "flags" in man pages. > [...] > We basically have the following feature matrix: > > - private / global > - expedited / non-expedited > - sync-core / non-sync-core > - rseq-fence / non-rseq-fence > > For a total of about 16 combinations in total if we want to support them > all. > > We can continue to add separate commands for new combinations, but if we > want to allow them to be combined, using flags rather than adding extra > commands would have the advantage of keeping the number of commands > manageable. > > However, if there is no actual use-case for combining a membarrier sync-core > and a membarrier rseq-fence, then it limits the number of commands and maybe > then it's acceptable to add the rseq-fence as a separate membarrier command. > > I prefer to have this discussion now rather than once we get to the point of > having 40 membarrier commands for all possible combinations. All commands are currently distinct bits, but are treated as separate commands. One way of doing what you suggest is to allow some commands to be bitwise-ORed. So, for example, the user could call membarrier(CMD_PRIVATE_EXPEDITED_SYNC_CORE | CMD_PRIVATE_EXPEDITED_RSEQ, cpu_id) Is this what you have in mind? [...] Thanks, Peter