Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1191725pxb; Fri, 21 Jan 2022 11:54:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfBkQl0H9T0Y6PlVrH1caJiFMuFaTv8D9InalUyW57S/NzphIp6Vn4dEbbA4sgRE5qkbIu X-Received: by 2002:a63:aa46:: with SMTP id x6mr4085290pgo.10.1642794897762; Fri, 21 Jan 2022 11:54:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642794897; cv=none; d=google.com; s=arc-20160816; b=DWHqUHYPExfIWs70DcR+N+Yjlg417Whfjj4Ror54K8JID15lDHlYxNJS6thT8uzgbN +25wuFNOhah0xyB1ZnXJKntWsSkQYnDXoIrlWJrWgSfsTwFuI3xwRx4aYWmM0GIZEw8K 0suDwc0CWEOq70JlTxMe1yS9EGF9dG2MXkmwOY6EdlFZjewAbZZBVEHqcqul16L1DwPr Dk8T0B914rFfFEBTyab5UBlsZ+9pM8sDV9o4YnwBoDjCaejJ8webvFNZST1Hq1jUVT4u eT/5DlN77vAlLozPkCKS9N1JYUxcCRcdUXqvNkOAoEPiCNC4w0Imveqjom8bfmhvRzqA p9XQ== 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=n9+QuY0zH4n6DhdsHh/bGzBmsewJnPu1xsyY0wQOFNs=; b=f9RyvEm583Vm2QvYV8WC0LtYKyovwXQxb8xKPmV+6zVG6micvXxJ+p9OFb+a4VQB6A kh9AML0/9/Yy4+stJNfccfJq4F3L2uQ3IhaC9tTWz0QgTBrHId5L4H4D7nySngJS0rG1 x3b3GHWgIbISItpIBVGXUjad/0byMGs19YnA+ItH4elrxvxzc3kpW4xyNJFp+hvUJni3 UYZ/+o/XgOhfrcRkUJHPK+yS79Yw7uyEZqXU8+Kq7HYqhIDjb06Pj4Fh9OEQTgtzoiJu EFYA86cCUwlU3eHNsZnUCmufDHVr5Mf/ba2YVChhhnvN+vScTz6gLq34Keh7wMI2CVlN mo5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Qwr4sXWl; 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 ot12si15964750pjb.25.2022.01.21.11.54.45; Fri, 21 Jan 2022 11:54:57 -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=@google.com header.s=20210112 header.b=Qwr4sXWl; 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 S1356546AbiASRwu (ORCPT + 99 others); Wed, 19 Jan 2022 12:52:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356520AbiASRwo (ORCPT ); Wed, 19 Jan 2022 12:52:44 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E10C06161C for ; Wed, 19 Jan 2022 09:52:43 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id c66so6666170wma.5 for ; Wed, 19 Jan 2022 09:52:43 -0800 (PST) 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=n9+QuY0zH4n6DhdsHh/bGzBmsewJnPu1xsyY0wQOFNs=; b=Qwr4sXWlG63KPE36dssUlXfgc2ML4gn5DUWXdNefR/tdwjFsg7Y695LkndA6iRGRSt kTeZ+YBr95b8stCVFdmxVu0sQIkSPxHL5hVqZQiZmevmu74D5ALilFJ9gWC3jDvJZkHn bKdmr6EcNdM8IwETGj1/+v8U1zr2Vg+LJodTULKoDO7CzU5jTaXlF/gtnGWMITm+RWQA LnR0F810BIuRQPGwa9kw7AZzJwyju0XCYfqlG8fzIBB2Ml/04RkaM6LyvW1puu4OyK9f qRDzmmQwlVDvs38rwANgJ+GwjWXD6zOn0cIVQDXc3XkrDVbIKY5yEJIaUy2tiUsfxaGq Ec4w== 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=n9+QuY0zH4n6DhdsHh/bGzBmsewJnPu1xsyY0wQOFNs=; b=R5xlpGRm9B2fxQTQJBio4Qa0qZUFaq/jBF9Dx4isDv+b7XmO3cQV250wcPiVd3QfSE G7Gk8jyM7jxQhGObTsO6MKhDO/4SnXGXvleqYmGhOIKoBtqRvDz5xbFTa3JzUw0xwe3q i/XDP4vmSjXq9fnVaTLz3n8g77Kgc2VK9CiI13CtahCuR7jKRAwetjsyFE83MOmemK3M pLz6kH5JQE7THfGaGz3vfTNLQZ74eV9SXYZ89ZxzexaX8TJqfTwrssEISPeQPLRoWx28 wcwJ1cFv5Lwqdl3CF3SYKlPHwXzgogkpQp5/eSsx5NkYtxX2scVyX6uvBfiOayR1XUFA JvpQ== X-Gm-Message-State: AOAM532ewOdhoA35AUOOQR9kYjsiF7xsOz7HBDsLm4xSPfysoD3BP8XZ vRrHvW67XwTWHX4ePTIEIYOlygPl+B41iFKrw8si3g== X-Received: by 2002:a5d:6da4:: with SMTP id u4mr25831925wrs.82.1642614761924; Wed, 19 Jan 2022 09:52:41 -0800 (PST) MIME-Version: 1.0 References: <20211214204445.665580974@infradead.org> <20211214205358.701701555@infradead.org> <20211221171900.GA580323@dev-hv> In-Reply-To: From: Peter Oskolkov Date: Wed, 19 Jan 2022 09:52:30 -0800 Message-ID: Subject: Re: [RFC][PATCH 3/3] sched: User Mode Concurency Groups To: Peter Zijlstra Cc: Peter Oskolkov , 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, avagin@google.com, jannh@google.com, tdelisle@uwaterloo.ca Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 1:00 AM Peter Zijlstra wrote: > > On Tue, Jan 18, 2022 at 10:19:21AM -0800, Peter Oskolkov wrote: > > > =========== signals and the general approach > > > > My version of the patchset has all of these things working. What it > > does not have, > > compared to the new approach we are discussing here, is runqueues per server > > and proper signal handling (and potential integration with proxy execution). > > > > Runqueues per server, in the LAZY mode, are easy to emulate in my patchset: > > nothing prevents the userspace to partition workers among servers, and have > > servers that "own" their workers to be pointed at by idle_server_tid_ptr. > > > > The only thing that is missing is proper treating of signals. But my patchset > > does ensure a single running worker per server, had pagefaults and preemptions > > sorted out, etc. Basically, everything works except signals. This patchet > > has issues with pagefaults, > > Already fixed pagefaults per: > > YeGvovSckivQnKX8@hirez.programming.kicks-ass.net Could you, please, post an updated RFC when you have a chance? Thanks! > > > worker timeouts > > I still have no clear answer as to what you actually want there. > > > , worker-to-worker context > > switches (do workers move runqueues when they context switch?), etc. > > Not in kernel, if they need to be migrated, userspace needs to do that. > > > And my patchset now actually looks smaller and simpler, on the kernel side, > > that what this patchset is shaping up to be. > > > > What if I fix signals in my patchset? I think the way you deal with signals > > will work in my approach equally well; I'll also use umcg_kick() to preempt > > workers instead of sending them a signal. > > > > What do you think? > > I still absolutely hate how long you do page pinning, it *will* wreck > things like CMA which are somewhat latency critical for silly things > like Android camera apps and who knows what else. > > You've also forgotten about this: > > YcWutpu7BDeG+dQ2@hirez.programming.kicks-ass.net > > That's not optional given how you're using page-pinning. Also, I think > we need at least one direct access to the page after getting the pin in > order to make it work. > > That also very much limits it to Anon pages. I can use the same mm/page pinning strategy as you do. But then our patchsets will be quite similar, I guess, with the difference being server wakeups with RUNNING workers vs "lazy" idle_server_tid_ptr. So OK, let's continue with your approach. If you could post a new RFC with the memory/paging fixes in it, I'll then add worker timeouts, as I outlined in a separate email ~ 30min ago, and continue with my integration/testing.