Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3315474rdb; Tue, 6 Feb 2024 13:55:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU2oiNAy7vXbN1KYDEpT+kF+ZINbL+QFvC2sxK82KrTZVpDM6Nx2LpgTADjtlRea1CLYj5W8S5+GPf8HH37Ft+PIctgANOCqeLOd4z+Qg== X-Google-Smtp-Source: AGHT+IEqmd1Ehj8sT7k4DgimoYZ8aN+NR4pWGZmNJ/IYYut0iKvvJgi9AOTEBXnZf4EPOLKiGxjN X-Received: by 2002:a17:906:c102:b0:a38:32bc:bd24 with SMTP id do2-20020a170906c10200b00a3832bcbd24mr2694126ejc.36.1707256515210; Tue, 06 Feb 2024 13:55:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707256515; cv=pass; d=google.com; s=arc-20160816; b=qRkmYFpDEc/PFY1lPlImSxWQN2NKw0P+msNYRO5yvN47Y3WKUYC8VCvTyIJvDw7FZ7 mBz9KWonTKQw6wA/YTi9IST90MZJlP6mPrQ3zAijF9ooRozOj6eYmAvIGTmoLEnQ1L66 PFDEI1w+k2chpVYOzIsExPaeXyFTwnpFWcuEYBtIdFOxRxged67mFFNeezx5D2wepr1L Os2E/dmevlTBPV0oqMqeZeCW9RbDKO16M2dNaQ52sFi3slo0Qym3gj5ZJOB1FK423BRy fN2oMrUWNMKvvS24GsSheDjq2ptiZY9Jw9RfGW5kBASF9ELb029gD+9p+SmY0SA/sWYA 3Fcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=O7ZGfeGKBF9phLlyx19ES6xYPOfUrf5xaU9sp4daNKw=; fh=s+junzI1xAjttbZsOtfdybHbrckndwJGfwy81DgOQXI=; b=whJasdNj6oK6Edw+nP4EDXOhUPulH9IsGLr1ccvM+UTdxi+WYF6CJ3SQXNVqF1b1w9 GQ2ULezZe+UXXakDPGLJ/7uKvjBRzghZ7ilR5qIcU+P0QalEAvR3M5lBFGs7hGGeH/39 m67Wdi1hdy421HdGqvN7k1S0/Hnh0oLuNzzr48T24KnQgvuokZfGyT1jWUDLqRNpX8KP Ri2F5OZs2HFdRz/t8BB9N800Hmv9Ax+2MT7oMFpsxOxg9fyr+2ClGd01DGkFKWDM4qbc AoNncD5irGG+yOY9q5A0C+moQCObanuJmLtEYnf4WvygXkVN4jcN72nRFvajn1pqAGjV dU7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2zdUcalK; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-55658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCXvSAeGrZdMKA4BCIgBO4STSwDWBxP1/YoGhgB7RW2Ayc6OJmYbJ4Hk11c1t33XRkhLOGp1FsHvoQbZckc1xIjgN6s3M37cB8NYQbtSNQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gf25-20020a170906e21900b00a3856362680si2477ejb.691.2024.02.06.13.55.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 13:55:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2zdUcalK; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-55658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id AB8161F230D1 for ; Tue, 6 Feb 2024 21:55:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 731391BC3C; Tue, 6 Feb 2024 21:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2zdUcalK" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42D801B951 for ; Tue, 6 Feb 2024 21:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707256506; cv=none; b=fLM9c0QzHXKmp+BxTdg6p49E4WDKDElP9aKl9+OrtCrsYaM9OO/IIaRqo+KKAa++Qp+bcR19OUrDV75JKcdylp/urPyEXx1d36CFQlO6+2MOPK1WmwmB12f8MdU7fPtwI14+XpJGZHQSW57XMx2Y06OSoxdBbCHG8FQa9Ga2flg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707256506; c=relaxed/simple; bh=O7ZGfeGKBF9phLlyx19ES6xYPOfUrf5xaU9sp4daNKw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=hmE4RaurG1NAUoUnUc9OrxTtgP4qzHrCcXesUI2wjEY/h10zwFP/gTTkyslfCSVN1pLQP5S2XWhwLe3HPEVhhy5A0O5F67G0QbQtq7fcOVnbOucPwJYLSBELx0yvR9QmjJx8FdhYCe+HKy66BKYkDj07Z85fpubnWksTuNCohyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2zdUcalK; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1d5ce88b51cso66435ad.0 for ; Tue, 06 Feb 2024 13:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707256504; x=1707861304; darn=vger.kernel.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=O7ZGfeGKBF9phLlyx19ES6xYPOfUrf5xaU9sp4daNKw=; b=2zdUcalKnn+YZXPv6AcKXdycEemCfZvBdJ9vPdriiWbyEE/0pRRLzLOnZO5IyCPfnW +BEa+wWHb715KWUyu6M7alCUV94+wYXI3Iv3CN3mWIjcOIj8pDg8nHqFt3YNpR8Vm9pW /j1I7Eigz26zfjCABeS0c6OxLiTHVqvLkEJRPRCNfums7w3V3KyJGq7MhLSJ7X+dw0CA WrJCIQJ/1Box0QKcj8L3jW8riGpYsD42Eg3NQov7bWAbOlG5VNk8BwpoTstuItCs3c7d 1U+YV3PqR5a+Oq6t4Sk3YZd2OntOVwf1HphsyQWzZkJvjcX1ynN/x4xv2zalt2fBuJ6e +Cgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707256504; x=1707861304; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=O7ZGfeGKBF9phLlyx19ES6xYPOfUrf5xaU9sp4daNKw=; b=ZXO2goSGFeCHO8jtI4j1+UlcXBeJLEiMvdEo5gh0WQahMKdTOwwdb9N8lBnh091on4 LyOJ9KxCUxgbrQSouamc0VPD+DScf1/R2k4kpcqsqrw3Qzim8TTh2khJo/k1SK22wEbf 4mQJ67fDpcSNoDQLf15yRjzEHDOH1gQSL6jjVCjzqln3G0kUPDH5sO+xMTN8bCNgdNPk VmlFxxxZZIOye1NfIDjXXPfPEFqITrImT8STGdR8MnGXp0oHn2he6M956gGI2MU3J7Wd OUQdRgO6AihPiXzK9CbixWZXeMmXq5uPdoWczUjITkqOBMeNAJhi3oEWpWgkpbXqszhO sweg== X-Gm-Message-State: AOJu0Yw4bxH/OjlQ0XHA0t4N3+qZhDLAsVzauDxHSnRF9nN7Pk4ldvBl P+TUvWBkCKfQok91+TuoKylh4QNl9ekWcH8EG8jI8lM8RwTIob5rEDPnQtHKQw== X-Received: by 2002:a17:902:fa0e:b0:1d8:f3c7:fb84 with SMTP id la14-20020a170902fa0e00b001d8f3c7fb84mr20714plb.9.1707256504332; Tue, 06 Feb 2024 13:55:04 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUObQLc/4P3FBfH/BPqyDhUNeLdxMrYSOG3pecENOwwdNFznpdcBmnjbxnVpFdNRnu0xWaonwksEgwNElqebVAI/GNBsrofreyAqqf6jPv/ITpIEbB8F6opVv9Io8bLouBvV372MZx4xinXIJXzpGOEOWnARXbYq1M5ceb/onieCS4xkUCAyVtZBWwmrDBd4EdbkbgRTmtnHDFIk4MSuzq8xjyEGHGh1pkO5tewBXpoIGuqBeQ9RsOPyjhaBkmNJdZEFBPjxV4niR8HN3HzIjsGqfY7V9jIohC5D+Otv8aLolMMzTiprCpRIVTEnFXNiYvY37JtoWXHSbCLp+ngAvs0Wd6NYIzaMr/VHHBc3JgCTc8ixgVHirsp Received: from bsegall-glaptop.localhost (c-73-202-176-14.hsd1.ca.comcast.net. [73.202.176.14]) by smtp.gmail.com with ESMTPSA id pl6-20020a17090b268600b00296df9fc8bbsm43356pjb.14.2024.02.06.13.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 13:55:03 -0800 (PST) From: Benjamin Segall To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Daniel Bristot de Oliveira , Phil Auld , Clark Williams , Tomas Glozar Subject: Re: [RFC PATCH v2 0/5] sched/fair: Defer CFS throttle to user entry In-Reply-To: <20240202080920.3337862-1-vschneid@redhat.com> (Valentin Schneider's message of "Fri, 2 Feb 2024 09:09:15 +0100") References: <20240202080920.3337862-1-vschneid@redhat.com> Date: Tue, 06 Feb 2024 13:55:02 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Valentin Schneider writes: > Proposed approach > ================= > > Peter mentioned [1] that there have been discussions on changing /when/ the > throttling happens: rather than have it be done immediately upon updating > the runtime statistics and realizing the cfs_rq has depleted its quota, we wait > for the task to be about to return to userspace: if it's in userspace, it can't > hold any in-kernel lock. > > I submitted an initial jab at this [2] and Ben Segall added his own version to > the conversation [3]. This series contains Ben's patch plus my additions. The > main change here is updating the .h_nr_running counts throughout the cfs_rq > hierachies to improve the picture given to load_balance(). > > The main thing that remains doing for this series is making the second cfs_rq > tree an actual RB tree (it's just a plain list ATM). > > This also doesn't touch rq.nr_running yet, I'm not entirely sure whether we want > to expose this outside of CFS, but it is another field that's used by load balance. Then there's also all the load values as well; I don't know the load balance code well, but it looks like the main thing would be runnable_avg and that it isn't doing anything that would particularly care about h_nr_running and runnable_avg being out of sync. Maybe pulling a pending-throttle user task and then not seeing the update in h_nr_running could be a bit of trouble?