Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1595786rdb; Tue, 20 Feb 2024 00:34:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVZ8Km0RamlrKGyiUq4hxLCknwmZzGEeCYExDK3JhEiz9cTEs5Ow9oi6xXUHqeDXpygeADqLDNdeGN7YzC3A4ltHvAmBLBN+3c3ynEJYA== X-Google-Smtp-Source: AGHT+IE2UFyQ4C6Kltwsk0AYoSo/GRyLhIZUVdT9FlaUaYVCqFL/fDlMlqP4LjJboh+1QcSAOe60 X-Received: by 2002:a17:90a:cc9:b0:297:24da:887e with SMTP id 9-20020a17090a0cc900b0029724da887emr11720379pjt.18.1708418062085; Tue, 20 Feb 2024 00:34:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708418062; cv=pass; d=google.com; s=arc-20160816; b=HURJUbPqRwVTvcn8qyNoQ8moHqUyZPQRijBsDg6vy1nJB5RopXJ8/l3ZqyVeiT8Z/G V2+fP0RhUTJ5OfW+QVHaX055kE+zumeR34kmSyyItnPocj8kc1fqCmUzGQJ/kAV0BCMn PU8CKQswe/LYl3iMSXt98IVKzfyWmek3G1OumFIWHB7anFaoO0XxPjdKU7D5B3itDZrt ylUP54+fn4di9DpNThklvSJcBFrpZM3mVszLYCBlLGEoapDU5skpEb6TqyySIqocZNPF P9mQoHOZ+74SSgO0JK/ZQ15PhDpvd7WOtRi4cptxKmGm+t76p7GDHAXRBgt3Lxf/KwxU w8fQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=smUuUy9+CrBm6NpqpU3RJ7+AwzkCrSsEVXBB/b6ojZ0=; fh=HDfTQkXsJ5J13Wk5V/CJ905d0/rgQh+Mrt07gTSd0TA=; b=o1NPb6NjNqFsoTVEVVuLxKKGrN6ADBuCwBpxdjPpjFT9ezN+IkOXjYSSqTkRwrF5hF oMORnHb5/u9fBjC5L+JrWKZPCvoi/wCYMWI8PqCBHBmdTPGTABQBNFw9Ks+1xOBuLrdC WYex0NedKBmpDNkCq3ihlh86TGhHDxr0JNhmu4mr8Rwpg/JezAtBauqc0gNSt8F36F0r nvPXuzMMfgIO3UkFIU94aPUgk6aHKMw3Gjln3zwcBXypX5OShF0ek1qG66Z7dP5+rS/p uwzSpBVBUMjo3DYdYyhAHdbrUA1+NEGPEoJstM03tl6UWEJMXIZwJr1QZxvd9Rz7VgVe t29Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=likzK4RU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id si17-20020a17090b529100b00298fafc62b6si6084452pjb.19.2024.02.20.00.34.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:34:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=likzK4RU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 47064B22851 for ; Tue, 20 Feb 2024 08:32:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97B325D48C; Tue, 20 Feb 2024 08:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="likzK4RU" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9B7A55CDF3 for ; Tue, 20 Feb 2024 08:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708417923; cv=none; b=Kmfd7eEBqVr0hczsLFIknxh8t+e0mi2z02O7ElQYP6avpBy1TWmrdt1Qcmz6249ayBxbmXW7aCKttLmrmytKWy6TKP2mwKCQMS4E64uwdcFHDbCGDN1tFhclXyADVBHdkCltOSLf6ogurJzTNHj+Gt3jZAVHJZ/jiPDiwhTzvnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708417923; c=relaxed/simple; bh=b7CM9peUzLf3RI4hFbHqm2TZd4AMJDxnd+rVS6Fz1ws=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DKGjGaiCAkuWtSuCdDHx5g3WQ+ZYEhaNr4XgPbaoidVxIVUPt+aFO265AWlNAs4Tel41GeZySJjEXNMEnDnJzhBaLvXYoyyoYtM7mr2jHsEIk+lfoXuovHSViIRE9XXT6HM3bnpkNTzWCjTEFTZdja09WOwjyC7XKjBvIO3Q/b4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=likzK4RU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01751C433C7; Tue, 20 Feb 2024 08:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708417923; bh=b7CM9peUzLf3RI4hFbHqm2TZd4AMJDxnd+rVS6Fz1ws=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=likzK4RUF7yq8G9RQ9lGuCZLdPTTO0BiDX12fr36kIYxdjIQ4ownAc1HkQZqnn3ct 6HU+9A+egZmj2zORm4bly+g9G0ka2W4jhD1cp1/EKkBcY9BaGVvEQPcD/VxjqeAljr 6jvExzkz7VS38g6/iwl0SO9WXkzFVWnAxbu1SBXjVXeblGQSyLHxCjxZ2b2TKabQDw JmFwV1cD/FP4FXNlKr9Zr0DdDwhwsOMW6G5TmK03CEQ1hwhNy0362HDwYhi2ora1Pw 1A2xfvGa6t2/2xdG2i3n1SppihwNWAU5wSNV2uPXhakgXD+MwnNBjdox2tzgiYDWy6 yKh16wbeqRz+Q== Message-ID: Date: Tue, 20 Feb 2024 09:31:55 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 0/7] SCHED_DEADLINE server infrastructure To: "Huang, Ying" Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Luca Abeni , Tommaso Cucinotta , Thomas Gleixner , Joel Fernandes , Vineeth Pillai , Shuah Khan , Phil Auld , Aaron Lu , Kairui Song , Guo Ziliang References: <8734tosyb9.fsf@yhuang6-desk2.ccr.corp.intel.com> <23b87c48-c4b8-4b85-822a-33cffaf6f779@kernel.org> <878r3freza.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Language: en-US, pt-BR, it-IT From: Daniel Bristot de Oliveira In-Reply-To: <878r3freza.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/20/24 04:28, Huang, Ying wrote: > Daniel Bristot de Oliveira writes: > >> Hi >> >> On 2/19/24 08:33, Huang, Ying wrote: >>> Hi, Daniel, >>> >>> Thanks a lot for your great patchset! >>> >>> We have a similar starvation issue in mm subsystem too. Details are in >>> the patch description of the below commit. In short, task A is busy >>> looping on some event, while task B will signal the event after some >>> work. If the priority of task A is higher than that of task B, task B >>> may be starved. >> >> ok... >> >>> >>> IIUC, if task A is RT task while task B is fair task, then your patchset >>> will solve the issue. >> >> This patch set will not solve the issue. It will mitigate the effect of the >> problem. Still the system will perform very poorly... > > I don't think that it's common (or even reasonable) for real-time tasks > to use swap. So, IMHO, performance isn't very important here. But, we > need to avoid live-lock anyway. I think that your patchset solves the > live-lock issue. I mean, if for you this is solving your user problem, be happy :-) Play with parameters... find a way to tune your system as a user... use it :) But your problem is also "solved" with RT throttling without RT_RUNTIME_SHARE (the default since... two years ago, I think). So there is not much news here. IMHO, it is not a solution. As a developer, there is a synchronization problem in swap code, and pushing a workaround to the scheduling side is not the way to go... > >>> If both task A and task B is RT tasks, is there >>> some way to solve the issue? >> >> I would say reworking the swap algorithm, as it is not meant to be used when >> real-time tasks are in place. >> >> As an exercise, let's say that we add a server per priority on FIFO, with a default >> 50ms/1s runtime period. Your "real-time" workload would suffer a 950ms latency, >> busy loop in vain. > > If the target is only the live-lock avoidance, is it possible to run > lower priority runnable tasks for a short while if we run long enough in > the busy loop? If you do it in the algorithm side (instead of relying on scheduling), it could be a thing. I think NAPI still uses something like this: Busy-loop for two jiffies in the softirq context (a priority higher than all threads on the !rt kernel), then move to thread the thread context to avoid starvation. In the swap case, it could run for two jiffies and then go to sleep for a while. How well will swap people receive this as a solution... I do not know :) I would first try something better than this using synchronization primitives. This patch set is for things outside of kernel control. For example, people running poll mode DPDK in user-space with FIFO priority; FIFO tasks in user-space for too long... with a better design than rt throttling. Will this patch help in misbehaving kernel activities: yes. Is it a reason not to fix kernel problems? I do not think so, and I bet many other people do not believe as well. -- Daniel