Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8619260rwb; Thu, 24 Nov 2022 01:55:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Z5t/d+YPRodBYwgYjZdnfF2HqkuKUG80L+lgwbkA04Qw90CJK3AhSUXd5iPGecapLbI29 X-Received: by 2002:a63:fc66:0:b0:477:49fe:2002 with SMTP id r38-20020a63fc66000000b0047749fe2002mr14509984pgk.512.1669283742938; Thu, 24 Nov 2022 01:55:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669283742; cv=none; d=google.com; s=arc-20160816; b=s1rWOApJQQqa/xchCNJ5JdUdgV+TfdzYRj7QWzfAWimZ6BL7FhYbkYSWXFWXYwkmaQ jg9dtjKxdGCl854NdIW8mLSwyhkju4C3K9IRl4qXo6zqOHXRdciDILVyp7ewyiFECrXh aZp7GkGyWyx2+4cI/ZHrylL9GjcDJKOluzM19de/oM8O0LZG5cakubOpFezYG9My6vsI Sw82OhU8opdX0ey8PYH35KD2+D0xJ+hKXFovkDDGDmeVp8sXUxrhIdFUCkciTYoMGfB5 AI4Y++w/aFp69qLI9YHDI6baEhA+Dm1wJTXkJVZ8XA7XKzsgsjhyjwR/ekcvdhj8FPA5 T45g== 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=rYKETZNIw+pj0LXb2Wyi36GtM0KwamzRnevtcxyrblE=; b=WPJnQenEGdPxplB0SHGI0ivKrivAcU5QDBXmYT7UziOjy8ecj/CbRd3J+x5AdWKkPy TkbIPX4ZBD5Lavm5wC7qFTWnUkYPJG1n5klF0Tnr0c1M9FaGhQvcZT9e99mnug7SISPn zjXNxO9cpmU9X8Ky7sFO63PlVKfRgjWySG7DRI9nQVTwJH8OfmcFgBtZP+sdNQ3PyklS DZR5bzVTBrC6oIScM1b1ru3zNWkJn2jWZppYsualbYxNq/8UXm7W79oFjdZtq8ivSdfV AyszFpJgJJ5yBL3vRINNRMg8tgXcK22lhSO25OsivJ1e3p0hQDhzSz0+1PRcTk27vE2h 2s6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=BE2GJmWj; 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 pj3-20020a17090b4f4300b001ed40b70436si911581pjb.155.2022.11.24.01.55.32; Thu, 24 Nov 2022 01:55:42 -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=@infradead.org header.s=desiato.20200630 header.b=BE2GJmWj; 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 S229666AbiKXJNL (ORCPT + 87 others); Thu, 24 Nov 2022 04:13:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbiKXJNK (ORCPT ); Thu, 24 Nov 2022 04:13:10 -0500 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 2569AA7C20 for ; Thu, 24 Nov 2022 01:13:06 -0800 (PST) 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=rYKETZNIw+pj0LXb2Wyi36GtM0KwamzRnevtcxyrblE=; b=BE2GJmWj8FcFlJeGphp0U+CMdU Ek4OwVIY+0wgIOZFoXZ1RhRwL8uMpwUVwAfIgASOchavvWe+DyMhNb2FJJjJTj24TRJAVBAxLWkGP 3fOn+pXhfg+87MR7GHIKI0KrdaNvBXFHhJ7CDXIqOHLSW22Gelmi50qdFT7zSP5tcH+oF48RpODAq TrRApHUGFYRCiaoMvKfn+XMe0+LuHXjXgOKd55paAr321SX7k9xkBGrhBEu7SGQ/TJPZyMCJAM34i d0cbHaR4POdUO7QF86KBvc6zgCXrnLJGatP33Za+50svtNZnBRyY13a+qO7oIx1Qzj9/Yq5yziER6 s3UFpMbw==; 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 1oy8Hl-0047dR-Jm; Thu, 24 Nov 2022 09:12:45 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 03129300202; Thu, 24 Nov 2022 10:12:43 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DA96E2B974B5C; Thu, 24 Nov 2022 10:12:43 +0100 (CET) Date: Thu, 24 Nov 2022 10:12:43 +0100 From: Peter Zijlstra To: Josh Don Cc: Aaron Lu , 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, Tejun Heo , Michal =?iso-8859-1?Q?Koutn=FD?= , Christian Brauner , Zefan Li Subject: Re: [PATCH v3] sched: async unthrottling for cfs bandwidth Message-ID: References: <20221117005418.3499691-1-joshdon@google.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 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 Tue, Nov 22, 2022 at 11:41:04AM -0800, Josh Don wrote: > > > + */ > > > + if (local_unthrottle) { > > > + rq = cpu_rq(this_cpu); > > > + rq_lock_irqsave(rq, &rf); > > > > Should we add: > > if (cfs_rq_throttled(local_unthrottle)) > > > > before calling into unthrottle_cfs_rq_async(local_unthrottle) to avoid a > > potential WARN? > > > > As for whether the local cfs_rq can be unthrottled now after rq lock is > > re-acquired, I suppose it can be. e.g. another user sets a new quota to > > this task group during the window of rq lock gets dropped in the above > > loop and re-acquired here IIUC. > > > > > + unthrottle_cfs_rq_async(local_unthrottle); > > > + rq_unlock_irqrestore(rq, &rf); > > > + } > > > + > > > return throttled; > > > } > > Yes, we should add that check due to the case you described with a > user concurrently configuring bandwidth. And as long as we're doing > that, we might as well make this unthrottle_cfs_rq() instead and snip > the comment. Peter, would you mind adding that delta? Done, should be pushed into the queue.git thing momentarily.