Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2666921rwd; Fri, 16 Jun 2023 06:48:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7HVL9QzV7XjcSNBYGhJSxGVuAcVm2mJRqkw2Te8itW671PjB6Qp/gYzSrGng5OY5igcc+i X-Received: by 2002:a05:6a00:1783:b0:654:424b:17cb with SMTP id s3-20020a056a00178300b00654424b17cbmr2264018pfg.14.1686923321293; Fri, 16 Jun 2023 06:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686923321; cv=none; d=google.com; s=arc-20160816; b=rWuXwfq0n6WU2qyP1za/LTKYhXg0WgNKlKMpyPuMg+Q9lmQPPhtizKCo4drpIt02Xk LSaZzx2Gm3YfmdjSqGhYPoGCN8LxABuAks+aCzlT3/TYcsreiDm9Rrj/Dhf3XjqqjdXT XA2I4FU8v33msChwfWLTbrLKNqho1Ih63YvWYgw7dg4yUA72/nsmlcIIqBsPP23H3yZc CljkgybXhKi0FnZBcb8n/Ch+/F3RqQIsC1dCLOdG1+Uvejl6y0U5aZqoyk9vj42D+mgR IoLOaJYBqUQt1ujo0NTLQnzgx5QA+6PNB4wgeHf1NrgrbUsJYh5g8h8lA/L17+z1Ct+a 7/rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=fWXZVf5eXioNtrH9ZX9gbUyQH+84qWKTjr1g/6Fm8Is=; b=ouMiIJUGEJjguHXKq81UU6Ixa3QUrx7ijQLx74NWFrCaa5XXSwm/sUEFkmE+N/54dY W5tttsKw0kGEBIjQBlAXU3/8kZC+z2V1BNTy/STZ12HlKGYvDCkT3YGPsWQ1YAxFnm/R 67IBXbNlt4LBYMO1RMIVGMOFs7NFEZWwB5DsPMCd8nRjy843EQeWOkZYfBDhSBnm/TSd pP9urrKKfDUSJyQxZxaWgyBrUZWlFx3fs4rtfnh6v1vLjskIYUPPhqbzkZo7p6AKDOgK KMNVOyd6crTKPpzHKrabjN1R5YWplAlz0eDk3CYUf1TH5mhSwrxaJpojR2MS7VvPBZy6 b/dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BEqipxET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020aa79816000000b00666aba0e676si2757404pfl.210.2023.06.16.06.48.26; Fri, 16 Jun 2023 06:48:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BEqipxET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345638AbjFPN1Z (ORCPT + 99 others); Fri, 16 Jun 2023 09:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbjFPN1Y (ORCPT ); Fri, 16 Jun 2023 09:27:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B8061993 for ; Fri, 16 Jun 2023 06:27:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D0E9261648 for ; Fri, 16 Jun 2023 13:27:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3C46C433C8; Fri, 16 Jun 2023 13:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686922042; bh=HUJ5PO7QL/5rV0beVfosspKiaBRwlra55dH3FmfgxbA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BEqipxETpI3cUOtsInhnIHn5EIuWVs+zy3IQ0tUjNEaquOxfL7gG8wvopbig3a2JN qqje3cRT5evAvi5pzOO5xWZhr4ZoxDeuz9Xu8xh5P7yd6ZpFn9X6FsmIMmkDBBchNF 4/P2bPgfUGjao2Z/a3EY0CcbSreo94rQvGLDLbebk3lEBRNheIwYhS/3ptOXsBXJnF vNUFV4/hF8spEjhz6qkJCT2131FRtkigdRvDnpwzGOoaxB71tc1pmRhRAnVsrJVxCL yWpMpiNVeqT5ZrpU7Mn+EdHVAZnGgdhsXNO3t5n6RAHO94/2xTGkMpwnCaBs/2/UyA GPWuFkYIbCZrQ== Message-ID: Date: Fri, 16 Jun 2023 15:27:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [RFC PATCH V3 6/6] sched/fair: Implement starvation monitor Content-Language: en-US To: Peter Zijlstra Cc: Ingo Molnar , 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 References: <20230616115149.GK83892@hirez.programming.kicks-ass.net> From: Daniel Bristot de Oliveira In-Reply-To: <20230616115149.GK83892@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/16/23 13:51, Peter Zijlstra wrote: > On Thu, Jun 08, 2023 at 05:58:18PM +0200, Daniel Bristot de Oliveira wrote: >> From: Juri Lelli >> >> Starting deadline server for lower priority classes right away when >> first task is enqueued might break guarantees, as tasks belonging to >> intermediate priority classes could be uselessly preempted. E.g., a well >> behaving (non hog) FIFO task can be preempted by NORMAL tasks even if >> there are still CPU cycles available for NORMAL tasks to run, as they'll >> be running inside the fair deadline server for some period of time. >> >> To prevent this issue, implement a starvation monitor mechanism that > > Why should this be prevented? FIFO can be preempted by a higher > priority FIFO/RR, or in this case by DEADLINE, and always by stop_task. Yeah, but in the context of "real-time throttling" the user is not asking to run things as SCHED_DEADLINE, they are just running FIFO, and expecting it not to have SCHED_OTHER jumping in front of them. If we do not "deffer" the starting of the server for a point in which the starvation is eminent, we can create some anomalies... for example: A Interrupt wakes up a FIFO and a CFS task, which will will run first? The CFS! A FIFO schedules a deferred work on a kworker... the kworker will preempt the FIFO. It is counter intuitive for the majority of people out there... It will be counter-intuitive for most of PREEMPT_RT users :-/. From one day to the other their tests using cyclictest will... break... > Just accept this. > > Anything that's build around FIFO-99 not getting preempted is just plain > broken. Don't try and pander to broken