Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7023324rwb; Mon, 5 Dec 2022 23:19:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+XfPy8/279hoCVjhoU503Xzj2Ic13IvRukSiynRRSQtJXeleO7oD7I3B6iZOhIcP+6luN X-Received: by 2002:a63:f346:0:b0:477:b53d:19 with SMTP id t6-20020a63f346000000b00477b53d0019mr54665125pgj.166.1670311172397; Mon, 05 Dec 2022 23:19:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670311172; cv=none; d=google.com; s=arc-20160816; b=v3cFyGmp1yvxbwJYw6/cxTwLaksuhHptx0ywlZYvaUf9/aLT6JxlDVh4t1ZdCFKO6C vQ/qwYcPAqABM3K+t4zMIyPOnMv43WmvkI5qZIpVHO5sE8nAUigJ6mplzEcyX77xYtoL ZAPyS+a0cV5pXpHDLiDLxbJu4YK920L7Z9J20qFjvn4zPAT0anIwquXMbaL9rUAN5SLK IeBNUk3QLPfjC0FXlqXoUznl3WWDcrBLPTUmBg3bWmP6LSUcZT00hJkMoQgFSW/fO5nL KTOwmud8PXix52l5oAysnlJjmkMfxhE3HkiBcKlZBkYLsi4AMycX8570s551fj592zmC PGOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/nf/VegHe9+DqsAeyPteKwkpo+sm1WkuqI0IKT/1miE=; b=eKxNNDD7VCRPOrwI7rkFHro7yeaGei1pw999B0M+QDmDb5K7oBHA8LKZTEbvSGndXF XDqv8ppnkaULKj0BOfh47bz+2vNCRlIquUCTRLJuV4fJXeD0cF7NAERbLTwlJd1R/LQs 0bSArjPUmiNMRtaDgtc6y7ghCXwEdWznxIuQFmnnwhDxNYQM20lzbx8UsJyev5Zhqx/U TMsDK+ma6dWlH32dld/ZsJV6YAZY8wDpMSzZPepMV0N9UL2+Tc/4q/vYQzUktI0EqPx0 95nieyhcFWenZs66V/4HfW6E5qahSRoHZqDcIQgi9ymy8xl7Pud910nPraDVItuvEEas Ussw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cYPDJXaD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020a630b52000000b0047760609a73si16451342pgl.57.2022.12.05.23.19.21; Mon, 05 Dec 2022 23:19:32 -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=@gmail.com header.s=20210112 header.b=cYPDJXaD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234101AbiLFGxG (ORCPT + 80 others); Tue, 6 Dec 2022 01:53:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234123AbiLFGxC (ORCPT ); Tue, 6 Dec 2022 01:53:02 -0500 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84BB6C765 for ; Mon, 5 Dec 2022 22:53:00 -0800 (PST) Received: by mail-yb1-xb31.google.com with SMTP id c140so17417052ybf.11 for ; Mon, 05 Dec 2022 22:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/nf/VegHe9+DqsAeyPteKwkpo+sm1WkuqI0IKT/1miE=; b=cYPDJXaDoeFowhUH4pRW6EN1R1ExMdSekmsCVfiJDlNC4/QXiNUQ9RYeysubclPBKu uSHg0e2noHIScncTRwd81FjDH1Y95yeuZEiHmcXT07Snk3pqnWC7uaHVbLgcbEbZNs5e SKOZixmdHzs2JvVmiqrl+lRCWQcm9XvQOvVTcfsRQOv9QCYRkr8rflXuhlB0OhdQXvUF 3o8Udjlmx68Kn01WEWO3sAfUMLVU0IJm+YBx/F5ygCr/xkdLtpCAedrVDfJ35rj6OZn/ LfDGjnMad/ni4Bb4m2WcguVHd3lYfdYjodrg8o4HwpFdEBhdOSviz5yshQPP9i7D5yd/ RIrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=/nf/VegHe9+DqsAeyPteKwkpo+sm1WkuqI0IKT/1miE=; b=k1Y4ryG6/WNwoiBpIbxf2oXpzTdoTpFxdblSG0dr9pA37BIWwYcEN9FzWcefnsQmyI 4vfz+pzSyrL1OqS844xl8h7vciPXNt0n7hArYh1B0vrPYaWKSCPQFfF2oXZo/d4XPZTF vQcfy6/5mizbkX14aNect/l40cfoWb77mKTqnI6ywKHnhgUJj4mxBYafj0e1FzgkbKyA 7luWlR3IjzzVzYI9DgkEA3Cb6wkzePxDxZ/dbk9MSNNyzosrOTQfV99umb9Uere8cRim 78kPcTj5Rj54CVa/KG+m+h4O3JnF6ZuRAFEYCUvSj9yZdY5knBD36D0IlrqxZtcV2VrP DvIA== X-Gm-Message-State: ANoB5pnRZugktwzsVF04eIil4t7Gs/X0TObYJl7MTzvGuNg5tMza0TnI ybwLIqj+Pw0i0UHhzraoonyWWK8OuK0TTp5K83w= X-Received: by 2002:a25:c0d7:0:b0:6f4:fad9:731a with SMTP id c206-20020a25c0d7000000b006f4fad9731amr41616099ybf.400.1670309579517; Mon, 05 Dec 2022 22:52:59 -0800 (PST) MIME-Version: 1.0 References: <20221111073154.784261-1-avagin@google.com> <202211181438.7D252CDC10@keescook> In-Reply-To: From: Andrei Vagin Date: Mon, 5 Dec 2022 22:52:48 -0800 Message-ID: Subject: Re: [PATCH 0/5 v3] seccomp: add the synchronous mode for seccomp_unotify To: Peter Zijlstra , Ingo Molnar Cc: Andrei Vagin , Christian Brauner , linux-kernel@vger.kernel.org, Andy Lutomirski , Dietmar Eggemann , Juri Lelli , Peter Oskolkov , Tycho Andersen , Will Drewry , Vincent Guittot , Kees Cook Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Mon, Nov 21, 2022 at 11:52 PM Andrei Vagin wrote: > > On Fri, Nov 18, 2022 at 2:38 PM Kees Cook wrote: > > > > On Thu, Nov 10, 2022 at 11:31:49PM -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 back to the > > > target process. In this context, "synchronous" means that only one > > > process is running and another one is waiting. > > > > > > The new WF_CURRENT_CPU flag advises the scheduler to move the wakee t= o > > > the current CPU. For such synchronous workflows, it makes context > > > switches a few times faster. > > > > > > Right now, each interaction takes 12=E7=9B=9C. With this patch, it ta= kes about > > > 3=E7=9B=9C. > > > > > > v2: clean up the first patch and add the test. > > > v3: update commit messages and a few fixes suggested by Kees Cook. > > > > Thanks for the update! If I can get Acks from the sched folks, I think > > this looks good to take. > > Peter, Ingo, could you take a look at this series? Friendly ping > > Thanks, > Andrei