Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3508084pxb; Mon, 24 Jan 2022 11:02:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxb8Yd8468uIFFLM5fgc0b3SgLnkw5wj0a1d0+Ol3Y8UU6J7Oofps4ZADwy4QD2sI6DjGaP X-Received: by 2002:a17:902:74c1:b0:14a:d9fa:d8a3 with SMTP id f1-20020a17090274c100b0014ad9fad8a3mr15716352plt.119.1643050923149; Mon, 24 Jan 2022 11:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050923; cv=none; d=google.com; s=arc-20160816; b=SmHsEsR7dbRA/W0I5FF8h7/H2UW27Egj/NXt473mZ5mOWzhgjR8ayfUIIorm6yFM6D 4otZuYe49BlGmbbf47wE0wWkmlLGE1OkBjDBpA1kv12XPoP+l6OIEQPxwTXK0qTl5VVV dr0YNCty7zF8c2INdJIse9IT5HnoiGJQGpHCMpBqsxTVtxm2mt1n4TSTJ0gvqAnAwFIA DNtoYfHc3EaGl1StkhQWGQZI3lHjJyNCAIMT84p90zDD+UCAXt0v32CGAB/DsNxm+Lrv bAljrHpBlEIh4Zd9n21lHdlWuC9fs4WwQ8WtZ4iuVzW/3gpyMT3/F6/cEE0JHY6dPEhv dq9Q== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rGu/cVWqjKbmzWm5z1cUS5DKdCStpKhIQFvlPXr3oH8=; b=mqUGrRzgxQ4Z+V01tYur87TK+F8JCmDWoLDSxonChbM5bPezqMGH4kBSt+ke08+AN3 nccIA1pyc518IBRfxFK1NQF9GUDp37foaQcC2+cZgFhk/lzcWh1VciRA93TXY3uGqDLt QqFiX24j8hWqR1ywYXLrWw+VbhyRuHnooNQVOwJyQhOTYMlhtpaQJ2hi4yWXLxwu/E9g sZepI0XjqztUPFgHYFksVZAGma/bA9mU+rBLCHE2F7ft6Ww9mIpqiF9Tn7GfZBpU3BE8 faksR+T/+HLMgw/CyCyBIx2Uqn70pKpEtOHAzNZ8+hpsm7D10K9s9Xdeli81We4f0pGm 2v2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=CwKvv+au; 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 a12si6983732pls.162.2022.01.24.11.01.49; Mon, 24 Jan 2022 11:02:03 -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=@infradead.org header.s=desiato.20200630 header.b=CwKvv+au; 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 S232212AbiAXKH0 (ORCPT + 99 others); Mon, 24 Jan 2022 05:07:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiAXKHZ (ORCPT ); Mon, 24 Jan 2022 05:07:25 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B811C06173B; Mon, 24 Jan 2022 02:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rGu/cVWqjKbmzWm5z1cUS5DKdCStpKhIQFvlPXr3oH8=; b=CwKvv+au3sSLPXpQy/TCrZHQxU y7J6x6rF3K+Ea/cuj5iosEJNVPaaD/mPPNaCKdy/qC5EzvZromUcN2uO1yDJ+Dn0mm6/O0aydVD1D 551ijFJi6+hIWWhXTayb+4OrSC4ht5ZjSWD5NreEEFg/2LuALzbFg2WCIPSMlBQidHcLDirOzMNv0 c39rSxzScRcI8rEvzqrmX9BC4x9oaF9adr0bjyTSSVa6+71Ulcbpwf1H56PsRuNp+rHrkbXuALn+p noONmub4xKIE2/UcTrfJkMQXXMbT7uPYl6VJliu6Vm/YfrckXv+ZdvAHyxwvQ5VDJBRoMOFqoUUvE gDZkOYRA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBwFd-0038Lz-2D; Mon, 24 Jan 2022 10:07:05 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id A2863986245; Mon, 24 Jan 2022 11:07:04 +0100 (CET) Date: Mon, 24 Jan 2022 11:07:04 +0100 From: Peter Zijlstra To: Mark Rutland Cc: mingo@redhat.com, tglx@linutronix.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, x86@kernel.org, pjt@google.com, posk@google.com, avagin@google.com, jannh@google.com, tdelisle@uwaterloo.ca, posk@posk.io Subject: Re: [RFC][PATCH v2 5/5] sched: User Mode Concurency Groups Message-ID: <20220124100704.GC22849@worktop.programming.kicks-ass.net> References: <20220120155517.066795336@infradead.org> <20220120160822.914418096@infradead.org> <20220124100306.GO20638@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220124100306.GO20638@worktop.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24, 2022 at 11:03:06AM +0100, Peter Zijlstra wrote: > > Either way, it looks like we'd need helpers along the lines of: > > > > | static __always_inline void umcg_enter_from_user(struct pt_regs *regs) > > | { > > | if (current->flags & PF_UMCG_WORKER) > > | umcg_sys_enter(regs, -1); > > | } > > | > > | static __always_inline void umcg_exit_to_user(struct pt_regs *regs) > > | { > > | if (current->flags & PF_UMCG_WORKER) > > | umcg_sys_exit(regs); > > | } > > Would something like: > > #ifndef arch_irqentry_irq_enter > static __always_inline bool arch_irqentry_irq_enter(struct pt_regs *regs) > { > if (!regs_irqs_disabled(regs)) { > local_irq_enable(); > return true; > } > return false; > } > #endif > > static __always_inline void irqentry_irq_enter(struct pt_regs *regs) > { > if (arch_irqentry_irq_inherit(regs)) { > if (user_mode(regs) && (current->flags & PF_UMCG_WORKER)) > umcg_sys_enter(regs, -1); > } > } > > Work? Then arm64 can do: > > static __always_inline bool arch_irqentry_irq_enter(struct pt_regs *regs) > { > local_daif_inherit(); > return interrupts_enabled(regs); > } > > or somesuch... Ah,.. just read your other email, so your concern is about the user_mode() thing due to ARM64 taking a different exception path for from-user vs from-kernel ? I don't mind too much if arm64 decides to open-code the umcg hooks, but please do it such that's hard to forget a spot.