Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp81177lqo; Tue, 7 May 2024 12:50:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUEfY1LCy7ZLAlT6wWPHS611EbCdaVGLoXteP4CJZSWTQouu5C1Afd+PC0wlk5XXcnDSuwt/mADZYf9Ses2J+C/TjpGfC5wobDqMRq0Vw== X-Google-Smtp-Source: AGHT+IFLuiJXuiek0YUBAllpKUkwDjFWVekScHVmyyv3BXNQNbBnriPywRmi6DGpI5SCeXllMVPu X-Received: by 2002:a05:6871:7393:b0:23d:1a0f:f034 with SMTP id 586e51a60fabf-240984445d2mr721530fac.46.1715111419001; Tue, 07 May 2024 12:50:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715111418; cv=pass; d=google.com; s=arc-20160816; b=Zjq5s23WgFSMKPcc8PYYgAEQgl0pghk2eG3GQ5zxQWVIH2w/IwmdfErpijchOjVBXE c0OhkzbIEEa1eyJDsVITx56f6tzuKphm9Xq8Z6cdGl/bFiDdCCX/WSZfvm46Z0kJ1mIR 9iszlCKXOaNPsrPu0TErX/mo5gPZs8mEkcMMjr3YYfyNVjhG//tYh4tVDicPruelp42D cmY1J1cs2cZoO3T2P0rN3GW7JW1QjPDO9RKhkXdVRXLEwV5l37DRjw6cLOPRf5f6QsQP TGhtrZ0aBmiRYnPNQdoqbrA0HwzxHv/Er8QNg0PqTsloFJyaHw9DKuJ6kbu1sSNzSXH/ VmAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id; bh=MM4Dl5dC1Re/BaL3KxbbzVSu9uQPG+/wVKmxbJqqnms=; fh=iZ1S0nPx3CqDfk/mTVElvTa1PgTIUEgIh/4zI98LzJ8=; b=OVOajlzU2nsb0OWUbQtjkMVzk/uf7vQOeGGAu7BsTA4hg0dEy8qQm8IpcHJ19fyA3h Ud3O8CJ4FgFSsOaFk94jVC+y9tq0t6eks+rFcBtvZXBgKjRChw5N2WeL7K2cvtqe8NAU B40pqzZuUQMMq+exsUqDYbv75B6AH1HsH4uHnvJWccYIPeKipiS9C3nHBXLgKRvjaP7r TewJIE4ef/rQAXOrH8oMmwm7lijgSf9YKOXRmcm4DNJLdqiQAVVWHIHtVX2q8zjpmdXP dmWX2Vtmt1iSB/nzfZCFrpVHfD42jHWqU8jU6liVTSahL8VG/3/NwkOd/V1bBPTpDH3s LWeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shelob.surriel.com); spf=pass (google.com: domain of linux-kernel+bounces-172074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172074-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i184-20020a636dc1000000b0061e1b2977a1si7349988pgc.248.2024.05.07.12.50.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 12:50:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shelob.surriel.com); spf=pass (google.com: domain of linux-kernel+bounces-172074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172074-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7DBEC283CD7 for ; Tue, 7 May 2024 19:49:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C72916C690; Tue, 7 May 2024 19:49:15 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A01F16DEAF; Tue, 7 May 2024 19:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715111354; cv=none; b=NuOWKcFW9HtmacBLRSnirOGylf7BUpYtO1BXesBOg5oXOsoziQ5+SLagM3vKfeUIPoarAtSYG88jwaHJKSfjoU1I7eTcFDVu262DB025qtvDyWC1xJKps1US2Ihq/zJJ6b9il/EERGNDkkfF1w6YzKQN8eEN/DZwfaYMPAmbPCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715111354; c=relaxed/simple; bh=MM4Dl5dC1Re/BaL3KxbbzVSu9uQPG+/wVKmxbJqqnms=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=dFID3ngm4NoWIq1U9kOxCtK8RBzbh1MsEY0+kL2TrArG6dYVjU/LLCvuUP/Pxx09EBe5Vs3PQ3NReDsGvynwjPZ3BAjMMzWQNLgPZNw7zfq5oztlzV5lwdakBZOOcqc9pdFIyxgANZ04irNSB0MqCbi0dFw0ViyEnAYUFhd0eTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=shelob.surriel.com; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shelob.surriel.com Received: from [2601:18c:9101:a8b6:6e0b:84ff:fee2:98bb] (helo=imladris.surriel.com) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1s4QmM-000000004Mh-09Sd; Tue, 07 May 2024 15:47:10 -0400 Message-ID: Subject: Re: [PATCHSET v6] sched: Implement BPF extensible scheduler class From: Rik van Riel To: Tejun Heo Cc: Peter Zijlstra , torvalds@linux-foundation.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@kernel.org, joshdon@google.com, brho@google.com, pjt@google.com, derkling@google.com, haoluo@google.com, dvernet@meta.com, dschatzberg@meta.com, dskarlat@cs.cmu.edu, changwoo@igalia.com, himadrics@inria.fr, memxor@gmail.com, andrea.righi@canonical.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel-team@meta.com Date: Tue, 07 May 2024 15:47:05 -0400 In-Reply-To: References: <20240501151312.635565-1-tj@kernel.org> <20240502084800.GY30852@noisy.programming.kicks-ass.net> <20240503085232.GC30852@noisy.programming.kicks-ass.net> <798768ad5db073d36467a432352b968b01649898.camel@surriel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: riel@surriel.com On Tue, 2024-05-07 at 09:33 -1000, Tejun Heo wrote: > On Mon, May 06, 2024 at 02:47:47PM -0400, Rik van Riel wrote: >=20 >=20 > > =C2=A0=C2=A0 I believe this can be solved with the same idea I had for > > =C2=A0=C2=A0 reimplementing CONFIG_CFS_BANDWIDTH. Specifically, the cod= e that > > =C2=A0=C2=A0 determines the time slice length for a task already has a = way to > > =C2=A0=C2=A0 determine whether a CPU is "overloaded", and time slices n= eed to > > be > > =C2=A0=C2=A0 shortened. Once we reach that situation, we can place woke= n up > > tasks on > > =C2=A0=C2=A0 a secondary heap of per-cgroup runqueues, from which we do= not > > directly > > =C2=A0=C2=A0 run tasks, but pick the lowest vruntime task from the lowe= st > > vruntime > > =C2=A0=C2=A0 cgroup and put that on the main runqueue, if the previousl= y > > running >=20 > When overloaded, are the cgroups being put on a single rbtree? If so, > they'd > be using flattened shares, right? I wonder what you're suggesting for > the > overloaded case is pretty simliar to what flatcg is doing plus > avoiding one > level of indirection while not overloaded. It does indeed sound like flatcg is doing almost the same thing. I'm not entirely sure what to make of the fact that we both came up with the same solution to the problem. I suppose it's a nice improvement over a fully hierarchical solution, especially when it comes to overhead, but there is still a fair amount of complexity left. I don't know if there is a simpler solution to this problem. There might not be. --=20 All Rights Reversed.