Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp844209pxb; Tue, 14 Sep 2021 09:54:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyz/FCtJn8V/PGblYi1pDaDOSHJHS0qgDmfm+tcN15v+Kx19D5+4JyZKhJC2nlLNBX+48B X-Received: by 2002:a92:6802:: with SMTP id d2mr12624244ilc.40.1631638449254; Tue, 14 Sep 2021 09:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631638449; cv=none; d=google.com; s=arc-20160816; b=fRvK6ElG+N20ISNL0MhxuUIiXedSWCkGxavVaMskCIh1RL5X6UUhKQlLPaCL1hkrhd KDrAgbuOJwIvA3/YXy4Qbv61BF3s4w5Rat56pr+bg6vQt2UxOHNSSydaQq7ykyJXNoMv kTmS6hT/OFz+QzdNKYUxEqHSsiJ7Z1XmxsRwgD/JdNYsPRTw2k+7vMiLXx4GXO+euxoN Z/4cXTg0y7D/7LmD3yDARcMrPQHcl8cwJaF3YcUtudgUUjoset3p6ZVv1eHnCnGdbe93 idB4pFYR0MY1Dn/2XigmWQPvxjBZLUP2kxLJKDb08uvQcDXp5StvVS47W5Jlip6GD9Nw ShYA== 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=SjSQE15uKcrKRnQuwXqswKvc6fyo2MaxbsLWDKYQ4RY=; b=QBgTpz1mjo3UeF0zIjeAdSK9+welIzoMx/pDGKy3EV8gDtvEp44D4XAerzJQu1Muoc Bq8UBskKAYhzdSfpA8xpeHC3JzJRLgDjz6FpG8tdtWYhg0cS4Z9dDvWpdkllLGfqG3hP owlbMVgXEUW1FHhfrj3RhBtp1tL3OgZBovzN16V1EWD1CUnjNPHkBgYhgryH1/1oDQ4h yxpLe7IWiq38uoSpIlP5wCM30hDgSlKK3/Mwh89Ck0Lv3wu6dffx6BWtfMXF3AzRQVNn F2cFFY7tcMVGSYvltz40CWlS6vf2es+Un5bi/r2XBKa6H7aFfvE6084YMC3xW1Tlp1cQ TWcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DO2pmRkT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m47si9365269jaf.133.2021.09.14.09.53.57; Tue, 14 Sep 2021 09:54:09 -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=@google.com header.s=20210112 header.b=DO2pmRkT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229960AbhINQxA (ORCPT + 99 others); Tue, 14 Sep 2021 12:53:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbhINQw7 (ORCPT ); Tue, 14 Sep 2021 12:52:59 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D7FCC061574 for ; Tue, 14 Sep 2021 09:51:41 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id k4so30234824lfj.7 for ; Tue, 14 Sep 2021 09:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SjSQE15uKcrKRnQuwXqswKvc6fyo2MaxbsLWDKYQ4RY=; b=DO2pmRkTjsKJiTLCol77A0gNdGwgoMm2ep17W0C9mucS7ff/YCFdWbSHs2ErU6fhPu YUzTMjtCt8PLZc31uy2O+m8HW0pswP6pDCYl1qQiX9gB0CrYRIo9fUGPJbMM1HH3oalL HrPPpKM1rd1RoAq3HwZSYyx1VeRlEHHMYTGmLqu3hR00cj54+41Zv283qlza8SvPKvAZ tanO7zyNiVbf6CE/ZEjUZBkJjLVMDxd2b13weLL0PMmqUaggV+EuLDXmU/dD1sz0bLCz uSjKQVgCiuuPHwY7GioyHiEl0/b3gCsHQ4b6BfK75gOdCzG7324Z83iVL+FENUbnD4e/ a5jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SjSQE15uKcrKRnQuwXqswKvc6fyo2MaxbsLWDKYQ4RY=; b=jaX0iDudeJ4zuW+DvqG9G2vR5HfKtr/XjIDdsRw0v41COfj/Z5FzETB/AhCMWk5NZ+ mdbHcKyWj4PpiEnwsux2Cf/sT/ofP3jaWDSEycuUhYkPr92BzaqWSN4j4LzuCzGMLzbl H3dI6oYAg9/CDsMQPSplJ//T1VYywkoyW7s/mAm71L3w8PDLDCBlvIIPallg0kh44RvJ QCNaXrskMpghLq3QNqsxQj+84eAI6j8Ih+wQRu4WMuxrBRHo7XHZPS2makv1qZPJ5ztE 53JQBr7PYaraXPJLjajcJ2JJSb2INAcrHudyqIE0hGXY6xS3igfHEQTbKp1+C5Bx2u4e ZcSg== X-Gm-Message-State: AOAM53015M3JxbMFp6LftGh9WaDdbrsMNnBOnHOXxjkfN0QhhWlj864M 9CDg0baqnlHJnh3qlgE6y5ZWkjyk1bj+x7ZM5LNIxg== X-Received: by 2002:ac2:4e98:: with SMTP id o24mr13877402lfr.295.1631638299813; Tue, 14 Sep 2021 09:51:39 -0700 (PDT) MIME-Version: 1.0 References: <20210908184905.163787-1-posk@google.com> <20210908184905.163787-4-posk@google.com> In-Reply-To: From: Peter Oskolkov Date: Tue, 14 Sep 2021 09:51:28 -0700 Message-ID: Subject: Re: [PATCH 3/4 v0.5] sched/umcg: RFC: implement UMCG syscalls To: Jann Horn Cc: Peter Oskolkov , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Paul Turner , Ben Segall , Andrei Vagin , Thierry Delisle Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 8, 2021 at 6:40 PM Jann Horn wrote: [...] > I think umcg_idle_loop() should never be called from scheduler > callbacks (meaning umcg_wq_worker_running()), only from UMCG syscalls. I'm moving umcg_wq_worker_running() out of core.c/sched_update_worker() and into /kernel/entry/common.c/exit_to_user_mode_loop() (and will rename the function appropriately). It seems rescheduling/sleeping there is fine. I'm not yet sure if this is all that is needed to deal with UMCG_TF_PREEMPTED flag; but I don't expect to see any locks held when the task truly returns to the userspace. Maybe I'll need to set TIF_NOTIFY_RESUME in sched_update_worker()... [...]