Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp434752rwb; Thu, 12 Jan 2023 07:59:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXuPA8aoHH4+FGogidv2drxff8Wl0TsKhP7HUgzJ5Gxl+NXG1Xxx0R071uyVhusnnUyboV7a X-Received: by 2002:a62:b50c:0:b0:587:3153:6080 with SMTP id y12-20020a62b50c000000b0058731536080mr15899066pfe.31.1673539141317; Thu, 12 Jan 2023 07:59:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673539141; cv=none; d=google.com; s=arc-20160816; b=AolWo3HME0rzDtxNVqsHvZEvkkh4XFHFrGMYwerWWXitCcFnc0wPt/j/s7uUZf4SvF cB7ZPgglGnCO+UY5LXxXE3zBvn8nWFZLOUhaxQsMhpbWonVNDONw/HyBDwlzOL1XYv56 JrkbbZa5mYsmhS5uiMi4tboEiaSy95cShrubeVY16x81+EIJI8sLOjcydVk7bzauVIsA dosyh9AxjxM+Of8VNx8wOxUXUmXHZVFYyTuT6q/l4ipPw3wOmdqbjCJ351Y86go3NhMP vV7kiJ54qSAzQgSNAe5yfP5/e3DzV+rlu3fMUlo0GBTfalpQuUMNn/YfYPeh91RkDi44 yuAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=LqqpGtID4VjpEU89F09GHBCJBYnLV9JhpECNMhPFXFA=; b=r2FbTxWZm4lIqF61/nATGnxvRekPEyTj1MJ2iH2k1FEkYaF8D/MuetUdvQKMdP+6UM +AjR53mj6P7uvQaVE8zRqEU9sXEYlgf5a/ift/i7Xn/1+HNFJ0czgLcIcCIf47Hc8lF/ RqXI8kEEWV0KSTa8ApVzuUI2k879QRUzo5k8u1gw/CfqaxE18QpUdOaIwOfoNk605prU n5M7XJoWmSRVP4LEBz5MsnnAdlk32PANon0U7/oYFZSHmC6OsjLRBnnEitXfgIZ9qh09 fwQYX9Hp6oLr5RwCYcbsLwfXZX5fT2PEX/DSG+OSI0L9IfdtDHx56z7VymDarPL6ROuX WGKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=m+TDaGzo; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="eP/+X8+C"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a6560d4000000b004bc46da9476si2479325pgv.564.2023.01.12.07.58.54; Thu, 12 Jan 2023 07:59:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=m+TDaGzo; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="eP/+X8+C"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240346AbjALPMQ (ORCPT + 52 others); Thu, 12 Jan 2023 10:12:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240229AbjALPLo (ORCPT ); Thu, 12 Jan 2023 10:11:44 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BCE32602 for ; Thu, 12 Jan 2023 07:00:32 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id DCD1F320097F; Thu, 12 Jan 2023 10:00:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 12 Jan 2023 10:00:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1673535630; x= 1673622030; bh=LqqpGtID4VjpEU89F09GHBCJBYnLV9JhpECNMhPFXFA=; b=m +TDaGzov1ZchoEywUVxJFNAhORAvI6eldmtzYwBEHQtovXtkkVuR6xLhD9R4UiA4 9FMkd6HRY6p93+Vqye/Fi2sk0fwwzBLY+kBtUSOJXiXzAv6BbbR9yae6ujHbZIua 8UIMkq7hJ0srFd3eQ5futPISn70HQYRSJKQBXs71OYYPe78J/WbYNpwNnPQiIYlX o7jDd9JfdqM3xLm2deppnQDFwdntxayQ3r/oGVDWbC8cJ5ZY1dYjA4zhR762bXUy fcL8Ar4INeDilQNhvsVafUUo0ZBXeKl8Z2UnzV4PoTzK6jtQSn0g8f5h7wISLLPE UulhwyoUSI4KNkmJLf//w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1673535630; x= 1673622030; bh=LqqpGtID4VjpEU89F09GHBCJBYnLV9JhpECNMhPFXFA=; b=e P/+X8+ClVAytJpkbDu8AyrTRsofXFaLtPRRE4e3Y4nHHKWoj3ifcZUsKXbKaakz4 LOMzPpaa9L6/rzXXPGu9YmDbMK/hf8cLWdhOu4dH/EprKJGUgY8ibn23gO5dmkpG 44c0RKW6l2GZwz1fiGTLuSm6cw2RSIe90Eg/v4gZdi8rQMe8j1Sbdj4QvqGDQiSl Xn5WCS1vAvz4xMkcAO7lFxB0MGqSFjV3bi52FuFPSCAnXkNnKDNPtW+Dg5tPQIak 8aDndJdBNdB7d9l7VE+sVf5tgNhHPcyJ8jZjqe65hnzyD4t4jVHXYYGCcHvsJ/Ak daGC0Fep5V2Nl0dL7ozmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeigdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjgesthekredttddtudenucfhrhhomhepvfihtghh ohcutehnuggvrhhsvghnuceothihtghhohesthihtghhohdrphhiiiiirgeqnecuggftrf grthhtvghrnhepffetvdekudetgeffueeivdeggeehhefhgeeuleffiedujefhgfdugfeu vdeivdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epthihtghhohesthihtghhohdrphhiiiiirg X-ME-Proxy: Feedback-ID: i21f147d5:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 10:00:27 -0500 (EST) Date: Thu, 12 Jan 2023 08:00:25 -0700 From: Tycho Andersen To: Andrei Vagin Cc: Peter Zijlstra , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , linux-kernel@vger.kernel.org, Kees Cook , Christian Brauner , Andrei Vagin , Andy Lutomirski , Juri Lelli , Peter Oskolkov , Will Drewry Subject: Re: [PATCH 4/5] seccomp: add the synchronous mode for seccomp_unotify Message-ID: References: <20230110213010.2683185-1-avagin@google.com> <20230110213010.2683185-5-avagin@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230110213010.2683185-5-avagin@google.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2023 at 01:30:09PM -0800, Andrei Vagin wrote: > From: Andrei Vagin > > seccomp_unotify allows more privileged processes do actions on behalf > of less privileged processes. > > In many cases, the workflow is fully synchronous. It means a target > process triggers a system call and passes controls to a supervisor > process that handles the system call and returns controls to the target > process. In this context, "synchronous" means that only one process is > running and another one is waiting. > > There is the WF_CURRENT_CPU flag that is used to advise the scheduler to > move the wakee to the current CPU. For such synchronous workflows, it > makes context switches a few times faster. > > Right now, each interaction takes 12?s. With this patch, it takes about > 3?s. > > This change introduce the SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP flag that > it used to enable the sync mode. What about just not having a flag and using the new primitives all the time? Is there any reason not to? Tycho