Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3355450pxb; Mon, 17 Jan 2022 18:26:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLkJ9a6P7k4ts8aNeiKYyfm+ZS82VZqXHvxP4r6tALslJIihokPYMWzrUjyUPtQ5VlvK/E X-Received: by 2002:aa7:982d:0:b0:4c0:e0b9:4e58 with SMTP id q13-20020aa7982d000000b004c0e0b94e58mr23722706pfl.80.1642472780163; Mon, 17 Jan 2022 18:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642472780; cv=none; d=google.com; s=arc-20160816; b=ygF7K//e0BzvlBH72jTrxcsgOT3iwmJK0r8kMZhXsudXi8DaeEBXgmJloZdvvqGAoF ZeGQvzmj6PcLbWnMsX5wNkogIOgAO2yJ7PcPbXCNOl/S89DfmvEDK+hhOlPWv40YOu4s neN1o6auWjV2jamP9Asx2AKfXP6XgczuUm/Zoguv41fl/iJxBW41IiBsWqJQr+AYhJ6U 5x7xMxxTnUUHUYWvplOEMQetlNAJaA4SBysSk1+V4w9ExtUepVdbuGGI3yqlMBz58dnO 6AKWsNj1+EKfha4JI2qQhhY5YAllyf/WtPXQLJo3Oo9qFsIjBOFHYjo9/R8IVkPxIjTn A2dQ== 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=okXnBIihNJ45zjlOgVaV9HIZ4gTPr/ksjRMtNE9fq8A=; b=dRcT8DradhAB/EvOX/lt6ElM15uocdr/IvoIwzOKdNKbxbQHeV6vE4PJ3aW2fKnuXQ hJ82jWwCjy0TBU7wnuLGTEMz67PXUy7vQc6C6vrI3HkvNtBH8ntpIvE9KN5ZiUQNfKnV ISyhfOjCmYDrIpp+Q9xB46lTcr3tNc2nsSTU+Y1bDIflx+1SI87VlIvQ95LoTIrfb5/3 onmGH5YI8S6ieG4OA9fWwQQ4TPVDjSvgDa0zkvO8u32vZVS+yk+MmmPBA3nHookxdbA1 NpH4A6TOJRCsiUndgIRf67dM4/LSo+eIjfPGtYG6cg7Gr0eF91oH0LdEWBqFB6QwQQBB I3xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=loMPvfhz; 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 k15si14086105pls.312.2022.01.17.18.26.08; Mon, 17 Jan 2022 18:26:20 -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=casper.20170209 header.b=loMPvfhz; 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 S240095AbiAQNFU (ORCPT + 99 others); Mon, 17 Jan 2022 08:05:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234253AbiAQNFT (ORCPT ); Mon, 17 Jan 2022 08:05:19 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D65BC061574; Mon, 17 Jan 2022 05:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=okXnBIihNJ45zjlOgVaV9HIZ4gTPr/ksjRMtNE9fq8A=; b=loMPvfhzX0Y2aCcY8FmyxPWYmv ra70tAkSHGlVnnENkpYDo41jNZOdowzu1iBT8Ud+sM4P5s0MCs7LriwvrzyUaugGV1d3iBS4T4/wr 1eCZPth/HiaKLbdOqeG7fJFvQD9ek/SCCjyW+ZwRhuJs02N3UI80H1KmocLVE5LK7xNc+LWy7Fb3Z B+mQPZpOK9l/3Sa9DoO6FvxXeJI2rSQEYceR1FHe+Y6tR4tEDP9XjYpQUhiAuIjVho7iaEw4kU0Lm 4+Ob2BRbptQZNdbtIQlUZMnCqrYn7D8n9ZRCc7ZxtRn0YN623Al6xsfFPaM3iPX2TkJZrfRHpAyvZ Njv6XwBg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9Rgu-008DFh-Cp; Mon, 17 Jan 2022 13:04:56 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 70B7C300237; Mon, 17 Jan 2022 14:04:54 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 27F832D675215; Mon, 17 Jan 2022 14:04:54 +0100 (CET) Date: Mon, 17 Jan 2022 14:04:54 +0100 From: Peter Zijlstra To: Peter Oskolkov 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 Subject: Re: [RFC][PATCH 3/3] sched: User Mode Concurency Groups Message-ID: References: <20211214204445.665580974@infradead.org> <20211214205358.701701555@infradead.org> <20211221171900.GA580323@dev-hv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211221171900.GA580323@dev-hv> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 21, 2021 at 05:19:00PM +0000, Peter Oskolkov wrote: > On Tue, Dec 14, 2021 at 09:44:48PM +0100, Peter Zijlstra wrote: > > +static struct task_struct *umcg_get_task(u32 tid) > > +{ > > + struct task_struct *tsk = NULL; > > + > > + if (tid) { > > + rcu_read_lock(); > > + tsk = find_task_by_vpid(tid); > > + if (tsk && current->mm == tsk->mm && tsk->umcg_task) > > This essentially limits all operations to a single mm/process. > Fine for now, but a fast remote context switch is also a valid use > case. It is not directly related to userspace scheduling, so I'm > just mentioning it here. Maybe server-to-server cross-process > context switches should be allowed for the same user/cgroup? (Again, > this is for later to consider). Doing cross-address-space UMCG will be a massive effort, too much (pretty much everything) in this implementation assumes things are directly addressable. > > + get_task_struct(tsk); > > + else > > + tsk = NULL; > > + rcu_read_unlock(); > > + } > > + > > + return tsk; > > +}