Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1302599rwi; Thu, 20 Oct 2022 10:54:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6VvhGhPntE8SGO7y318dyRRvu89YN81hvP3VWdjFxp+qMIF5HfJHq9UNR4ayr2C0SPqcgw X-Received: by 2002:a17:902:8e84:b0:178:57e4:805b with SMTP id bg4-20020a1709028e8400b0017857e4805bmr14920805plb.144.1666288488214; Thu, 20 Oct 2022 10:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666288488; cv=none; d=google.com; s=arc-20160816; b=CZ+uJcXvTZTdf7uwSomQPgdH0CahocTx3uoS3CMM02YasL0HgDEfSe1mDRlCMoHjFf vOeZ5o3vm2rifv55dwoM3uM0NY8WQi0L8CEvB1OQsVUtk9kDu+D8t1qOxelNY/p+JTOK K1SDWyybeS+RmMvUlGdbcMDX61nh0HbpOMauU6bbBZ/uMbbRTMM9nd2OUCEyo6c6hMGc MmOxy8Las4DcKZ9Fif9PtCcrjvJwKP5jwGyFCrdzQMqwQ4kcY2uFnmZDy1ZPaP4OcQvJ WHHeYaadphtyRZ9ek+lwaKDpsje1OuC2AQfnUSErHUev4TP3aaUJIQz4bcmFDapqHc/S lxng== 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; bh=Kpn8YsdQvhY0DWQ+ycOQ/aGzOPoScQBkvytFfq3DwZs=; b=XPQD5DYDQYedSpCRzlRpuKejQNlw4euOHIlp5ZVKQ/M27c3uOIfgljYV3hmhDqdgwh eEVqzBd/KKrKMBN9Uge7LXIamN5+Wa1adcgaY3y8R3K040hv5Iepu+gACEEwKaRO4bli m/ziZCsekbwBpUeTaf5Lwue6ca40Wns5bh7wgy7i3yJHrtkuShmyxOH0FzQeehpZQFGO jMX0XCjTesmWtmmyvuzWBZEihL6/16PWnu3OI8WoQN3nYeHKQeiOY2qRRg+d2dC4Qpfo gcSU8qy1p4RlPPr9FlIqrJBAEvDu4TxhJgmCmVuqLveyhmdOPYopHCBT/qlSX15ahU1V GU1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=L9bQ9wrK; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a170902dac500b00182fd75c741si24416735plx.372.2022.10.20.10.54.36; Thu, 20 Oct 2022 10:54:48 -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=@infradead.org header.s=desiato.20200630 header.b=L9bQ9wrK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbiJTRIa (ORCPT + 99 others); Thu, 20 Oct 2022 13:08:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbiJTRI2 (ORCPT ); Thu, 20 Oct 2022 13:08:28 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45B1A1A5B1C for ; Thu, 20 Oct 2022 10:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Kpn8YsdQvhY0DWQ+ycOQ/aGzOPoScQBkvytFfq3DwZs=; b=L9bQ9wrKo+47eo1YY4g/TZOSXH 1hXPatD4S/EgEA01uMln6dOg0g/QSIsmit+HGybZSxdPJ6jOb69zN0H+H0TYMXlCSzeJLV8miv21B huHRN+ycDHP3Be0tgmTkYUGVp1ZgzIidKxiqcF3elgQlKvpRBHol7my7BKO2HHJjqpJISGnskl5g7 OJNnvcEqCDIde+toKFsNZ2hrG2AXmtBO2nnpKkj/w/TsqCQHsQ3MTmSQWL5eLQQWFA+fr/VDsRolJ qU/yXVYsHIJ3WTyjCt0DUK5US7uuwsS+QLMj1wJOWuj6xc0K6nAWnKgDQPlPYh0ExpNOuzNuNlYd0 2ffLbTlQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1olZ1i-0055LV-CT; Thu, 20 Oct 2022 17:08:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F0350300209; Thu, 20 Oct 2022 19:08:13 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BCC902BF8156A; Thu, 20 Oct 2022 19:08:13 +0200 (CEST) Date: Thu, 20 Oct 2022 19:08:13 +0200 From: Peter Zijlstra To: Tejun Heo Cc: Chuyi Zhou , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, htejun@gmail.com, lizefan.x@bytedance.com, vschneid@redhat.com, bsegall@google.com, Abel Wu Subject: Re: [RESEND] sched/fair: Add min_ratio for cfs bandwidth_control Message-ID: References: <20221019031551.24312-1-zhouchuyi@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_NONE,URIBL_BLOCKED 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 Wed, Oct 19, 2022 at 11:21:19AM -1000, Tejun Heo wrote: > Hello, > > On Wed, Oct 19, 2022 at 11:15:51AM +0800, Chuyi Zhou wrote: > > Tasks may be throttled when holding locks for a long time by current > > cfs bandwidth control mechanism once users set a too small quota/period > > ratio, which can result whole system get stuck[1]. > > > > In order to prevent the above situation from happening, this patch adds > > sysctl_sched_cfs_bandwidth_min_ratio in /proc/sys/kernel, which indicates > > the minimum percentage of quota/period users can set. The default value is > > zero and users can set quota and period without triggering this constraint. > > > > Link[1]:https://lore.kernel.org/lkml/5987be34-b527-4ff5-a17d-5f6f0dc94d6d@huawei.com/T/ > > Signed-off-by: Chuyi Zhou > > Suggested-by: Abel Wu > > This is a bit of a bandaid. I think what we really need to do is only > throttling when running in userspace. In kernel space, it should just keep > accumulating used cycles as debt which should be paid back before userspace > code can run again so that we don't throttle at random places in the kernel. That's just moving the problem. But yeah; perhaps. Starving random userspace is less of a problem I suppose.