Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2089498pxa; Fri, 7 Aug 2020 02:54:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOdhzWvcMNlmTOw0TrBLOOeKZjXN9xzgwskAUSunm0u9Myr76IBgrXcxWCivfeXksfQyBM X-Received: by 2002:a17:906:7f05:: with SMTP id d5mr8336343ejr.122.1596794054972; Fri, 07 Aug 2020 02:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596794054; cv=none; d=google.com; s=arc-20160816; b=nyBGmFdNzOe9bARwg0CEtSO1hzYbFxCPEOrvF0tWSA4xSZOprZx1LkfKwpcmKimQ9O dltDHMNrTg3oywrW57kzTtBCMJwuRoU6PMTZylTCylxF6uVuIda+9ORfllnCxX9IfeTG s02e8jJLSlp2c2kN0HRtUUKdAV4Hj3sI+5TxwOFdMzuy5V7TgXXzG27pwHA7SjHdx9Nz AOMRQBcMgD0GZIzJ07Q4VgDFvyGf96a6pzW8ZfJFIv3+zn+IIZ5If/hhmpdRJKZSUK71 4KNA4GC+XRUitCY4OGvAEei2TmcR7j+qkATxIT9RiEKcfc3cFXEe7P2efHi8V6jlJtFx Lwgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=X4qR48J/hEHBI8WQZHhJvxYXozsSkTPR+3Eg1XuaID0=; b=tFnzl2hcPTjxo3YgGymjcUsQB53vRL8arDLso9d/Phg60tvcw5193Y+hhv+7StKEWL cB2RiIuJVxlUepCORpv7z0HnIUZtKedrO6jYvUvWt0j09lvxSZ27bwX7+9wnrug89dH6 92JbQUvyk62r8rpjcsQwelZx+umpjtr4AZ86cCZr1jJJY+vxXxGrZYxEZrhPEULINNcd op5nkmWC1U6wn9rRKBVn0RkXDpL/BzWcyBuLYGFwK+5OyhiasfU6oUzaPJ6ARldwsJVn xdeGyGtyF2x4fQyUgBOnCVk330USBu7FfeL9M2sTo9YbxI+UgNKlW2VtQjJTb0CiACCl iLcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=biKl23aT; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si4216430ejb.116.2020.08.07.02.53.52; Fri, 07 Aug 2020 02:54:14 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=biKl23aT; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728190AbgHGJvY (ORCPT + 99 others); Fri, 7 Aug 2020 05:51:24 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35430 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727820AbgHGJvX (ORCPT ); Fri, 7 Aug 2020 05:51:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596793881; 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=X4qR48J/hEHBI8WQZHhJvxYXozsSkTPR+3Eg1XuaID0=; b=biKl23aTwA+pskABZYkvtsewiRY6OkFEZ5K3MaVnKPixzECNvovUsi2GK5r6jMgPdPSJPL UhW4lUIqMs3Z1GWkUD6g5NonKHiw2tb7SAXhOgsvukEDaEVkUbZkCASVXFDdIYdApAHxig h9OuoyAabHDuqJ9L327yqqB2CJeVHLY= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-Fb1dNRcJP1agl8PsJj7X8w-1; Fri, 07 Aug 2020 05:51:20 -0400 X-MC-Unique: Fb1dNRcJP1agl8PsJj7X8w-1 Received: by mail-wr1-f70.google.com with SMTP id m7so534043wrb.20 for ; Fri, 07 Aug 2020 02:51:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X4qR48J/hEHBI8WQZHhJvxYXozsSkTPR+3Eg1XuaID0=; b=P6Xz+AOs1tsWak5W+KOcnNgiosrjsX6KhFOMLsnbsVsbhHGzYDx4kKa6Owg1ryCEjC BUZM63TcDwyYKzSPON8nbAAWkn/Nt+yd8hLKbaf2FHj5A+h9RoCTz2WMYyftEC3LvHv6 sHpxb5ATzqPXIyg/w6/c3dUn2JvK6gkyWAOnfdpOPgk4h2QJLS2bne8pdNmu7EJS9lI7 tDNvC1HkOGEavAm7qyUYWAMKm8nc83Ec1/84Kj3cKP6SmlJZKvoA+pIAE7KC+Fl+fyqC Qv5il/iBWbWAHuF7v1+sm+HqI+zj6xgX4eUadbAntUGXsi32W/v/0AQixZsC/BIN3nBQ ct0g== X-Gm-Message-State: AOAM530pcAyx7x/z/Ywzs8lMTpAhb+w+nJYSpY0rQGRAoavH/fJGd1a5 8eCGY3Cc9kHPJHfsDXq2cSYDhq4K/gKpMGZJgnkzBIvCzAavrtsPKASpIpE4ovo7ImEp/gwXYS1 kcDfijPT98uZfTsZOInTqYCGk X-Received: by 2002:a7b:c24e:: with SMTP id b14mr12781593wmj.128.1596793879014; Fri, 07 Aug 2020 02:51:19 -0700 (PDT) X-Received: by 2002:a7b:c24e:: with SMTP id b14mr12781570wmj.128.1596793878688; Fri, 07 Aug 2020 02:51:18 -0700 (PDT) Received: from localhost.localdomain.com ([151.29.36.84]) by smtp.gmail.com with ESMTPSA id h14sm9388396wml.30.2020.08.07.02.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2020 02:51:17 -0700 (PDT) From: Juri Lelli To: peterz@infradead.org, mingo@redhat.com Cc: rostedt@goodmis.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, alessio.balsini@gmail.com, bristot@redhat.com, dietmar.eggemann@arm.com, linux-rt-users@vger.kernel.org, mtosatti@redhat.com, williams@redhat.com, valentin.schneider@arm.com, Juri Lelli Subject: [RFC PATCH v2 0/6] SCHED_DEADLINE server infrastructure Date: Fri, 7 Aug 2020 11:50:45 +0200 Message-Id: <20200807095051.385985-1-juri.lelli@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This is RFC v2 of Peter's SCHED_DEADLINE server infrastructure implementation [1]. SCHED_DEADLINE servers can help fixing starvation issues of low priority tasks (e.g., SCHED_OTHER) when higher priority tasks monopolize CPU cycles. Today we have RT Throttling; DEADLINE servers should be able to replace and improve that. I rebased Peter's patches (adding changelogs where needed) on tip/sched/core as of today and incorporated fixes to issues discussed during RFC v1. Current set seems to even boot on real HW! :-) While playing with RFC v1 set (and discussing it further offline with Daniel) it has emerged the need to slightly change the behavior. Patch 6/6 is a (cumbersome?) attempt to show what's probably needed. The problem with "original" implementation is that FIFO tasks might suffer preemption from NORMAL even when spare CPU cycles are available. In fact, fair deadline server is enqueued right away when NORMAL tasks wake up and they are first scheduled by the server, thus potentially preempting a well behaving FIFO task. This is of course not ideal. So, in patch 6/6 I propose to use some kind of starvation monitor/ watchdog that delays enqueuing of deadline servers to the point when fair tasks might start to actually suffer from starvation (just randomly picked HZ/2 for now). One problem I already see with the current implementation is that it adds overhead to fair paths, so I'm pretty sure there are better ways to implement the idea (e.g., Daniel already suggested using a starvation monitor kthread sort of thing). Receiving comments and suggestions is the sole purpose of this posting at this stage. Hopefully we can further discuss the idea at Plumbers in a few weeks. So, please don't focus too much into actual implementation (which I plan to revise anyway after I'm back from pto :), but try to see if this might actually fly. The feature seems to be very much needed. Thanks! Juri 1 - https://lore.kernel.org/lkml/20190726145409.947503076@infradead.org/ Juri Lelli (1): sched/fair: Implement starvation monitor Peter Zijlstra (5): sched: Unify runtime accounting across classes sched/deadline: Collect sched_dl_entity initialization sched/deadline: Move bandwidth accounting into {en,de}queue_dl_entity sched/deadline: Introduce deadline servers sched/fair: Add trivial fair server include/linux/sched.h | 28 ++- kernel/sched/core.c | 23 +- kernel/sched/deadline.c | 483 ++++++++++++++++++++++++--------------- kernel/sched/fair.c | 136 ++++++++++- kernel/sched/rt.c | 17 +- kernel/sched/sched.h | 50 +++- kernel/sched/stop_task.c | 16 +- 7 files changed, 522 insertions(+), 231 deletions(-) -- 2.26.2