Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26267856rwd; Mon, 3 Jul 2023 07:32:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/hx6sBrDW9ratJACKGKOBQ1+WmPx9Ne/a7SjUO/s2YhIxsYFnADvPTOSd7HC6ggK3haE+ X-Received: by 2002:a17:902:ec88:b0:1b8:684f:5e28 with SMTP id x8-20020a170902ec8800b001b8684f5e28mr12551285plg.0.1688394728502; Mon, 03 Jul 2023 07:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688394728; cv=none; d=google.com; s=arc-20160816; b=pTOMIKXGU2QelFhbsKlyEV3ZLgaUVXxfE7VqOvQlN34OgLZzH3+IZUBCLegTqqa/sF YC0nZ/jy1uWIV9plCkJZ2GD6xQIMY8N8Nuw5soRx/q5e448DIWQybggLc5BLoUyxQafG 0RdY0ErR6yAr0Kh6x2MCZjjo7wG1P0y+1yfma6uEoh34D4WULhCKSNoqGV+LfPJBbDCU vtpcD5YFmglEXNoVUNDJY7crAhLpROsGCOMzvMyDTGB2f0zKrmcUsIoq9WsWJlbFvqSP 4e7jqs0llS4p+W4b7dYe/kD/a84PmoSGcvEwW/WBEvsiOg9j6NUClZGN/mZw0WXSqSOZ GJYQ== 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=bWre2H+VQNouRQ6zSkiSN5DK9acpqmsrbwpksV2nPh8=; fh=9o+p89qrpKznjE7JDbjnrTVIitOFonhzCnZZrLh2Yb4=; b=g8HDcX4uHd2gl6vWBLOa5xt6QJ2zT6FhC1vsV+ivCc+5vDTPUQ9owJ8zm/LfH1wKdJ AxPc9z96DWjvntVyhaGl310xuo8ipBf5mTfamGBOue56yq7PTBGfd51bI+YYm3rVahue 2OuQgTsgHKt2mq9DKDFTzuXxriBIQuI3vF4gP6TswvSry8XnZ54kr1jtn6hVqO8KTkOe wh5OFsm0JnB5fKYNJNvrX087GF5IKT5G/ZVFfeMAiIrx9REnaGifRsXqmoh3A3EVpryr F6LjBCwdtARe5jfYTjTlvas479GP1d0qeAk85CYKtxd/0tA30CWksn3l655kvjaEDaVK adLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PWZHx0Mu; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n10-20020a170902e54a00b001b8946f3f53si2849361plf.645.2023.07.03.07.31.50; Mon, 03 Jul 2023 07:32:08 -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=@redhat.com header.s=mimecast20190719 header.b=PWZHx0Mu; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229971AbjGCOUV (ORCPT + 99 others); Mon, 3 Jul 2023 10:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjGCOUT (ORCPT ); Mon, 3 Jul 2023 10:20:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB45E52 for ; Mon, 3 Jul 2023 07:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688393970; h=from:from:reply-to:subject:subject: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=bWre2H+VQNouRQ6zSkiSN5DK9acpqmsrbwpksV2nPh8=; b=PWZHx0MujO2Z5Za3dkcYqfebUoJNRZOgXqMrAflQQzeB1hZQdg2KEPObDGlIfZScbK6+QL gjlh8ub2WqYkO6Tro5MgTKtXK43Lc9w+kd6u5JIm/bxsRfIdoZzWASKmbQQUDCITz3ZHpr oSOQYGhHz8FTRF02lCib/A1ASB54FTA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-569-_epn-yvOOvOwntjVbXgXrg-1; Mon, 03 Jul 2023 10:19:26 -0400 X-MC-Unique: _epn-yvOOvOwntjVbXgXrg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7AEAB185A791; Mon, 3 Jul 2023 14:19:25 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.39.194.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F7F0C00049; Mon, 3 Jul 2023 14:19:21 +0000 (UTC) Date: Mon, 3 Jul 2023 10:19:17 -0400 From: Phil Auld To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Juri Lelli , Ingo Molnar , Daniel Bristot de Oliveira , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Ben Segall , Steven Rostedt , Mel Gorman , Frederic Weisbecker Subject: Re: [PATCH v4] Sched/fair: Block nohz tick_stop when cfs bandwidth in use Message-ID: <20230703141917.GB67396@lorien.usersys.redhat.com> References: <20230630135714.1018434-1-pauld@redhat.com> <20230630150641.GH2533791@hirez.programming.kicks-ass.net> <20230630152824.GC43299@lorien.usersys.redhat.com> <20230630160534.GA2534344@hirez.programming.kicks-ass.net> <20230630162910.GD43299@lorien.usersys.redhat.com> <20230703121009.GH4253@hirez.programming.kicks-ass.net> <20230703141056.GA67396@lorien.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230703141056.GA67396@lorien.usersys.redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 Mon, Jul 03, 2023 at 10:10:56AM -0400 Phil Auld wrote: > On Mon, Jul 03, 2023 at 02:10:09PM +0200 Peter Zijlstra wrote: > > On Fri, Jun 30, 2023 at 12:29:10PM -0400, Phil Auld wrote: > > > > > I think you are agreeing that I need the pick next code but need to remove > > > the hierarchy walks, right? > > > > Yeah, the dequeue case makes we have to care about pick, not sure we > > then also need to care about sched_update_tick_dependency() though. > > There is indeed a window where these two will 'race', but afaict it is > > benign. > > > > Hm, that's confusing. > > As I see it it's the enqueue case (0->1 mostly) where we need the check > in pick. At that point in enqueue we only have a handle on ->curr which > is the idle thread. > > For the dequeue case (2->1) we need the check in the > sched_update_tick_dependency() path because if the 1 is the task on the > cpu (and is staying there) then we'd otherwise clear the bit when we > shouldn't (since we aren't going to go back through pick). > And, for clarity, the "bit" in that case is TICK_DEP_BIT_SCHED not the new task::bw_constrained field. I.e. we'll endup allowing the tick to stop for a bw limited task and thus not solve the problem. > I'm thinking that I'll try to set the bit in pick since we only care about > it when it's the task on the cpu. That, I think, will simplify the > code needed to update the bit when the quota is changed (to or from > RUNTIME_INF). > > Setting the bit in enqueue/dequeue means updating it on all the queued > task if it changes. Although I may clear it in dequeue just to not leave > it around stale. > > > Cheers, > Phil > -- > --