Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4547719rwb; Tue, 17 Jan 2023 02:13:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvZyoBanPezm3yzRjZ+9/aDUNEEEikpPpU1f9pnt1S9OWJW1VK1H2+LJNbSJCLLL8f3zZ0c X-Received: by 2002:a05:6a21:594:b0:a3:a1ee:47ca with SMTP id lw20-20020a056a21059400b000a3a1ee47camr2125893pzb.46.1673950421319; Tue, 17 Jan 2023 02:13:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673950421; cv=none; d=google.com; s=arc-20160816; b=kn8P5zQbfvwaNXkeLBp8szT8X5sU2DnhS9RVIlTu1ohcebiBOwbg5hVRwhRVhAvOD5 K+H1u6AD+syEMo6M8R6XsD7Y5z75Xw+2oChCVeYDmEiMqgfyKqMqMcvv4VJoSFCmq0oU yNZleit3o3ISzlFdRfnMfLcxAC2xGHdwhSOVEphAkQc8NhmmcFrMyolXpCUwJECRBmXB Ft2jlUqDaYypjyR1DWuzjX6FpZ789FhHCATy961z8L0cxOOXRr17QFQaVup2jXAJ1yAG 9CnfHB0CQbPH9idHwCgbb+4ehe1FS/kyaRQSz2eQHyfV4+896bpREoAe/SBAXDv6WZEC VnuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=uXNsIh0lnYpgXnWoPchzigTDCYUxJKPhFr5rGbl3ro0=; b=ligkLO7f33wZ16eRckuoBbOE/qqEydaUX8drwzsXrQKAFMr0VXqowgnnrtnsy8g0jx socPI6bLVA0+LMd7FAw14TI/oYqI61dme5pTSNcMHY2ZOeqGDRvNGiYGZ3UYzVwV7n3E 85vFYj3pZsdz2v+H1+LSQCEhjY5YiJJrbneYwDcfFIjnTYdqBUuXFLMlyZt7v+C9+dBk a1FoTXd3TTFp91ol884f/7kjjzVuOVz59iqsq1rshAQz5ahJKgCu0UYPL9Tf27wyL3s4 4YKSWATA8+Xr/hPAKOopD+dB4OwzOY1i4EbKByl8fF8nfE3NdocD0oiBXaqyi6IU/bk0 wStA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=iN8lChSl; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e188-20020a6369c5000000b00476c369eaa9si31607410pgc.146.2023.01.17.02.13.35; Tue, 17 Jan 2023 02:13:41 -0800 (PST) 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=@suse.de header.s=susede2_rsa header.b=iN8lChSl; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236662AbjAQJfF (ORCPT + 49 others); Tue, 17 Jan 2023 04:35:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236164AbjAQJdZ (ORCPT ); Tue, 17 Jan 2023 04:33:25 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC15F59D2 for ; Tue, 17 Jan 2023 01:32:54 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 60CF73825E; Tue, 17 Jan 2023 09:32:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1673947973; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uXNsIh0lnYpgXnWoPchzigTDCYUxJKPhFr5rGbl3ro0=; b=iN8lChSlGzVoV2RkiHm/4oZyp2fUksV0PrH52fhk1TIxqikDnaBMyo7ESAy640eoVVnqsq rDL4ZLCypiPiWqENot9v3y8UpNXky7WBK5yhtWZqqnS8EdqnOTwr8qutOXXGfDv7fJlNdj +306hc2OBVFFri+T4pVnpY170bllk1Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1673947973; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uXNsIh0lnYpgXnWoPchzigTDCYUxJKPhFr5rGbl3ro0=; b=y6m+TzbZl0p7PNVLqQGjOvZKZdXmJVsv5VlMjGQEdvu8a1x8e8eGFZmzmjNoqquVa1ArbU wmnG/VhRWPdGNABQ== Received: from suse.de (unknown [10.163.43.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E0E4F2C141; Tue, 17 Jan 2023 09:32:51 +0000 (UTC) Date: Tue, 17 Jan 2023 09:32:50 +0000 From: Mel Gorman To: Vincent Guittot Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, zhangqiao22@huawei.com Subject: Re: [PATCH v4] sched/fair: limit sched slice duration Message-ID: <20230117093250.asfytnijs7zytscv@suse.de> References: <20230113133613.257342-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230113133613.257342-1-vincent.guittot@linaro.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Fri, Jan 13, 2023 at 02:36:13PM +0100, Vincent Guittot wrote: > In presence of a lot of small weight tasks like sched_idle tasks, normal > or high weight tasks can see their ideal runtime (sched_slice) to increase > to hundreds ms whereas it normally stays below sysctl_sched_latency. > > 2 normal tasks running on a CPU will have a max sched_slice of 12ms > (half of the sched_period). This means that they will make progress > every sysctl_sched_latency period. > > If we now add 1000 idle tasks on the CPU, the sched_period becomes > 3006 ms and the ideal runtime of the normal tasks becomes 609 ms. > It will even become 1500ms if the idle tasks belongs to an idle cgroup. > This means that the scheduler will look for picking another waiting task > after 609ms running time (1500ms respectively). The idle tasks change > significantly the way the 2 normal tasks interleave their running time > slot whereas they should have a small impact. > > Such long sched_slice can delay significantly the release of resources > as the tasks can wait hundreds of ms before the next running slot just > because of idle tasks queued on the rq. > > Cap the ideal_runtime to sysctl_sched_latency to make sure that tasks will > regularly make progress and will not be significantly impacted by > idle/background tasks queued on the rq. > > Signed-off-by: Vincent Guittot > Tested-By: Dietmar Eggemann Acked-by: Mel Gorman -- Mel Gorman SUSE Labs