Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp424965rdb; Thu, 30 Nov 2023 08:13:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IF59xP0dgSVLIb6/hqGAMvIkX2wjjNeZr1zI5aIqIx/YsMO2keQc3yLbBkIajp+AO9XO4/T X-Received: by 2002:a17:90b:1c0b:b0:286:4fc9:b5f0 with SMTP id oc11-20020a17090b1c0b00b002864fc9b5f0mr772208pjb.10.1701360829938; Thu, 30 Nov 2023 08:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701360829; cv=none; d=google.com; s=arc-20160816; b=b+K3EbKjXR/6OgGPCgdn+HKbm+YxZB11ucEcoBvlD9m7lmaPdOZacH38Nzo9rhccvO Q/nZrBlcvWaE7S56H4skRjb1NJfWpsppGqVro2W+WOjUNPMz7HusOtoCodZbXP3/iPOj FsgBDoSWP79ghOZ8EqPJzYWPVdoDE9N1jT2GQ+IkulqFD1Tg25sr239hdzl16It/XC6s rVU4pB3vLC1VadWISs3XB8r18FFMD6AojHxjWAmwM1+SVTngICFr61EpktXEx/nUaFLz doVVrlF/+X7FL1QhwUGZEhaDPv7HzRPM6DO6jO7K+FlrsRLJZ1GEPkk04aBs5AyXdyR0 Zq0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FpCx+tElFli3PJ+oneU0SXM88BJcbodDK/a7dugXEk8=; fh=rccdXjDr7taJt1Xx8LyTJhkceurMd91O1K8pulqufws=; b=VkugxbmPOvLN0h8/qqimzqy9lt5QdxvN2SkeHcWHrWstLWt9+Kki5+dXuCJ/3Mr5aW 8sWzfz5EELBVkcHgbSmMAmoXUtNBESs9pY79kwDvYYbgBlyrB1Uc/LWi/H+VEG7JNrMo xuUlFXuU+Yxnjizm5NygwkINesCph4XfE6Op7GFhOKvZonY9UGun5c7WfQiLTNIpRM5K q77qT+kwEWdFngQd0EqCqXyeiGZC5Z84DVXUiDbdA1zEx9oLi/Qr4eO9Fp6Y+NdHt79P 1w6WY9BxFzW4KuUXHib39QvKeJXTpIwsdLK0/NCDGx6cOdgzlCuMrPJjBPQtTass35wb /yrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=baIVJP13; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id x1-20020a17090a0bc100b0028558f4e661si1606089pjd.145.2023.11.30.08.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 08:13:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=baIVJP13; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 793408293B32; Thu, 30 Nov 2023 08:13:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232180AbjK3QN2 (ORCPT + 99 others); Thu, 30 Nov 2023 11:13:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232206AbjK3QN0 (ORCPT ); Thu, 30 Nov 2023 11:13:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF9F410F4 for ; Thu, 30 Nov 2023 08:13:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701360808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FpCx+tElFli3PJ+oneU0SXM88BJcbodDK/a7dugXEk8=; b=baIVJP13w67MIpmugDykzvWlMhEjmGG+s+PctseevpeMy18ZTpuAH3FM3UFJRippnXblTw viom+Qkl6N5LKp776MmreEI8UZjOfJf+evoyEZJr4KvDkT/fEjO6jLiMktnp4siVHBzq+P 161Hh3O84pYsZHF4+0ahzX2NHWUIUdQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-350-c9GEYIV5M9i-br_w5rxLiA-1; Thu, 30 Nov 2023 11:13:16 -0500 X-MC-Unique: c9GEYIV5M9i-br_w5rxLiA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C29B2280142B; Thu, 30 Nov 2023 16:12:59 +0000 (UTC) Received: from vschneid-thinkpadt14sgen2i.remote.csb (unknown [10.39.195.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08FCEC15881; Thu, 30 Nov 2023 16:12:56 +0000 (UTC) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Phil Auld , Clark Williams , Tomas Glozar Subject: [RFC PATCH 0/2] sched/fair: Delay throttling to kernel exit Date: Thu, 30 Nov 2023 17:12:42 +0100 Message-ID: <20231130161245.3894682-1-vschneid@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 08:13:47 -0800 (PST) Hi folks I apologize for the one-big-patch-to-rule-them-all, I tried splitting but I couldn't get to anything that made sense, so it's one big patch and a small follow-up. TL;DR of what I'd like to hear about: o Is there interest in getting this in for !PREEMPT_RT reasons? o Any ideas on how to make cgroup migration less horrible so we can fully pop out the throttled cfs_rq se's? Survives a good hour of my testing below on a 4-CPU QEMU system, but I expect the throttled clocks & PELT to be busted. Testing ======= setup +++++ mount -t cgroup -o cpu none /root/cpu mkdir /root/cpu/cg0 echo 10000 > /root/cpu/cg0/cpu.cfs_period_us echo 1000 > /root/cpu/cg0/cpu.cfs_quota_us mkdir /root/cpu/cg0/cg00 mkdir /root/cpu/cg0/cg01 mkdir /root/cpu/cg0/cg00/cg000 mkdir /root/cpu/cg0/cg00/cg001 read.sh +++++++ while true; do cat /sys/devices/system/cpu/smt/active &>/dev/null; done repro.sh ++++++++ spawn() { ./read.sh & PID=$! echo "Tracing PID${PID}" echo $PID > $1 } spawn cpu/cg0/tasks spawn cpu/cg0/tasks spawn cpu/cg0/tasks spawn cpu/cg0/tasks spawn cpu/cg0/cg01/tasks spawn cpu/cg0/cg00/cg000/tasks spawn cpu/cg0/cg00/cg001/tasks sleep 1 kill $(jobs -p) Valentin Schneider (2): sched/fair: Only throttle CFS tasks on return to userspace sched/fair: Repurpose cfs_rq_throttled() include/linux/sched.h | 2 + kernel/sched/core.c | 6 +- kernel/sched/debug.c | 4 +- kernel/sched/fair.c | 296 +++++++++++++++++++++++++++--------------- kernel/sched/sched.h | 8 +- 5 files changed, 204 insertions(+), 112 deletions(-) -- 2.41.0