Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp488717imn; Wed, 3 Aug 2022 12:28:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR6XZRMpGp4INvWLtCyCBjVIaWWdQ023DIX6ciynURqIBfOpP7d6/31MlGRFlO9fI5PFXEuo X-Received: by 2002:a17:907:7f11:b0:730:6f6f:e444 with SMTP id qf17-20020a1709077f1100b007306f6fe444mr13348005ejc.657.1659554918942; Wed, 03 Aug 2022 12:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659554918; cv=none; d=google.com; s=arc-20160816; b=TgQG1j0e/1uJKAHihj6erXlfjVy5LyVgZGxBSVeuMTygs6BepBu1S7r8/tQpxSZN4F vhEsuXqwNWmiB5YZLeTrXefwyRzL0wk1QNS9tQKE5uSikSX3szL8KSe33uux7GA6eBVd uZmzx1Mili6KTGTZhTHTBcozk/L5x50eZuatRR4pkuiHJZ/+ictZRYBGdloIHxP9290H DSP6DVf9G7ptzHC+aZHGhA5L/t+jiQWGhUqsva2ZpxhwknLXgN0wr3se46ekKGfFEjJ/ BWhEFGrqGEt7uJHKdeHYbbhcuPobY7oEWAKalLGfkJG0ufYW6rhgHY1vQc83obserH4f f9GA== 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=c0anUqpP2C7sKweDNx6tz5eeeYeeCajDunQoGL7Ybz0=; b=MZqdoztmXIR4qf6JLyfnwvIGAcP03J9zMs/CKwC5I8nFKh21E1si3oIJXi3sLDuTmZ yQxEpEr7l1ih0uVbmSbOGqjbyzSiApXN1Ktmz7LLc2FdqtSGsXgQ7PqahXeGMXDLe5xa g82wKvWOvyk1LkHms5rTylSQRXkJ43AQjhU2u5lXtZQwkCCCM5Vt4wEgzsVxOo2UEehj t1W4Q+Y4LmCm6yEkueDB0HgcchJHXLGLCYUtmrTDctEy7O9cZVYH+BQbAW3KhyrPQP2c zfEFZ2crCsmQ+1qtZEt6gzzQU4s15BwaZRj1+Lyb/3K9MtjdBGJD+Zdqf/ewqbIwNUb7 Zn1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=nLaoCQbd; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a1709061dc300b0072b9b9820afsi13528356ejh.845.2022.08.03.12.28.12; Wed, 03 Aug 2022 12:28:38 -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=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=nLaoCQbd; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238135AbiHCTWW (ORCPT + 99 others); Wed, 3 Aug 2022 15:22:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236278AbiHCTWU (ORCPT ); Wed, 3 Aug 2022 15:22:20 -0400 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB72D4D149 for ; Wed, 3 Aug 2022 12:22:18 -0700 (PDT) Received: by mail-qv1-xf2f.google.com with SMTP id q3so13641986qvp.5 for ; Wed, 03 Aug 2022 12:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=c0anUqpP2C7sKweDNx6tz5eeeYeeCajDunQoGL7Ybz0=; b=nLaoCQbdkBOJTfuCR3nvXQ6rGDdylxjmz1jZ8Tm+nJhB6uRVEzkJe9J4YvGiaLZJIB eWPFrU1LaDhgB2s2lw2eeu9wk/emPqRLAABUjCEPpahzxkyec1saBHzutYUk9LjwCn1W NDD4glL0si9CYF94gTQapu1l/uknEiTgOX1JK7P0ZfPvWAntrY41DosPltyCmtNzocQd u0y+VnjfLoLyPQNDeLJGLo35kTLX8U7m3Md4z4tb8wRmVQCEoDIBm+JIZRe1M2hFceis Nk7XsPtsik05vCUxaU21b6nk/4AzADB2kCAMEgmcUghE3x5ypb3WJtPKnhrzaNTK6OU0 cJHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=c0anUqpP2C7sKweDNx6tz5eeeYeeCajDunQoGL7Ybz0=; b=LnGjtH0RsSJZGwLFZ/rI1ay/O5T1ZGCSBdwfq4p9CiQ5uG6xn8HXHRCYs7RtVMNjCc 3rH9HxnEsuSOGxB5DQCcIq9AOFenarn506P0Lgo7eh1pHPfR1O+nOIYsqJoGex2o7oBk /OdxwSeSrT2bR6QkCKYabR/Nj1ZnYl/i3X+sFD4HyAFN+sq09LwnzyDDSVrIWjfgyaIx 0LgQ4o3EpTUESu913VR+jc+G+J6uX6NOfbwQ24lzRauAHxAVgvDNpNQgb3inUvAlboHA A8SoWw2ZmHotopid+Mb0BTg2IrdYny1Yz0TpgzGheUg5r4S/kk77IG6vIlUx8XUVuoSV wuEg== X-Gm-Message-State: ACgBeo2aYduNGTQll922BpSFOImnVgatvPhwnzqGWdi7ZfKG8ePwJmOy ITfWg+qa7C2bf10bzrla/q4M2A== X-Received: by 2002:ad4:5f0a:0:b0:474:8978:9a9f with SMTP id fo10-20020ad45f0a000000b0047489789a9fmr23754893qvb.71.1659554538002; Wed, 03 Aug 2022 12:22:18 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::a0f2]) by smtp.gmail.com with ESMTPSA id bm7-20020a05620a198700b006b629f86244sm13216262qkb.50.2022.08.03.12.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 12:22:17 -0700 (PDT) Date: Wed, 3 Aug 2022 15:22:16 -0400 From: Johannes Weiner To: Tejun Heo Cc: Chengming Zhou , surenb@google.com, mingo@redhat.com, peterz@infradead.org, corbet@lwn.net, akpm@linux-foundation.org, rdunlap@infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, songmuchun@bytedance.com, cgroups@vger.kernel.org Subject: Re: [PATCH 8/9] sched/psi: add kernel cmdline parameter psi_inner_cgroup Message-ID: References: <20220721040439.2651-1-zhouchengming@bytedance.com> <20220721040439.2651-9-zhouchengming@bytedance.com> <5a3410d6-428d-9ad1-3e5a-01ca805ceeeb@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Wed, Aug 03, 2022 at 07:58:27AM -1000, Tejun Heo wrote: > Hello, > > On Wed, Aug 03, 2022 at 08:17:22PM +0800, Chengming Zhou wrote: > > > Assuming the above isn't wrong, if we can figure out how we can re-enable > > > it, which is more difficult as the counters need to be resynchronized with > > > the current state, that'd be ideal. Then, we can just allow each cgroup to > > > enable / disable PSI reporting dynamically as they see fit. > > > > This method is more fine-grained but more difficult like you said above. > > I think it may meet most needs to disable PSI stats in intermediate cgroups? > > So, I'm not necessarily against implementing something easier but we at > least wanna get the interface right, so that if we decide to do the full > thing later we can easily expand on the existing interface. ie. let's please > not be too hacky. I don't think it'd be that difficult to implement > per-cgroup disable-only operation that we can later expand to allow > re-enabling, right? It should be relatively straight-forward to disable and re-enable state aggregation, time tracking, averaging on a per-cgroup level, if we can live with losing history from while it was disabled. I.e. the avgs will restart from 0, total= will have gaps - should be okay, IMO. Where it gets trickier is also stopping the tracking of task counts in a cgroup. For re-enabling afterwards, we'd have to freeze scheduler and cgroup state and find all tasks of interest across all CPUs for the given cgroup to recreate the counts. I'm not quite sure whether that's feasible, and if so, whether it's worth the savings. It might be good to benchmark the two disabling steps independently. Maybe stopping aggregation while keeping task counts is good enough, and we can commit to a disable/re-enable interface from the start. Or maybe it's all in the cachelines and iteration, and stopping the aggregation while still writing task counts isn't saving much. In that case we'd have to look closer at reconstructing task counts, to see if later re-enabling is actually a practical option or whether a one-off kill switch is more realistic. Chengming, can you experiment with disabling: record_times(), the test_state() loop and state_mask construction, and the averaging worker - while keeping the groupc->tasks updates?