Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4233597rwb; Tue, 6 Sep 2022 04:49:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR56DP/53zZvSuV78bvlqH8xXEMHLhCndYFqiv9rD3WvOdcih7yvTkV5D9EwO7b5PHdWQ85v X-Received: by 2002:a05:6a00:b41:b0:52f:59dc:75 with SMTP id p1-20020a056a000b4100b0052f59dc0075mr54801344pfo.33.1662464974793; Tue, 06 Sep 2022 04:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662464974; cv=none; d=google.com; s=arc-20160816; b=b40APCd+bFqnjpf822nf/ib2p4diiYtGPjQvgWDPzkZLkhjQs/NAKH7R/9TwjTVuTW E1i7pxGDrsjQSu9GD5BkspHe4ccKJT2GentN8iBxOmRCEEXUz573FD/Jpj6gD9qoFKMY TwXFPdZ0yznv4VPtgyM5SR2qY136VVZFFP1uDg/sV6dlw8/Wy2VF2zw8093wDt2c4ei1 dYXePSjqNIUgMvvkzHQxKSjC+XP9ZI0conNBMiqzp12PbBku5nZ6bGznidoN0u/X1s1G 6NhLBPkdeqK0yKFK7RcMWUOUu4YszIskqDnjiIb1Z6GN1SB12Q/ybeZyK9gksbGX88Bv fGuQ== 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:subject:cc:to:from:date:message-id:dkim-signature; bh=zLIlU5WRN/qpc/luGxAkx8MLhJShGTdf13t85Wt12A0=; b=PalXqwxqnKsTzg14xn8Cz8SKbGr8/zvGEQlC7HeKaKBYahXMZZdmsDXU1dnzZIJ9en 7EOJvEDpSfnRyUvLkkJyEz6ONgmfwrCEr2EnhDa3tZB1mBidVAj9kTAz2vRJlb+0TWQl vjpTehoNXFCQoKSnMhWbJdaX9Wqb8ZJIJsGKcwLjzORzM9UtTIskow5vFC8RRNJPRkEP U0uDmcbR+yLAB5aNdbBhbfzm0yS2GBVSPZ378Jdq1QVJaywCuGFCLLOlFog9kZJ0IO3H N9sovoMOCqSzm+tUYR9622PH2LHS7+fuCZ+BUkAyV5Xfp6DCvRRCjoFD24BUTiJ5j8fO sKEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=efebxuxD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x186-20020a6286c3000000b0053841790f09si12582147pfd.81.2022.09.06.04.48.59; Tue, 06 Sep 2022 04:49:34 -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=@gmail.com header.s=20210112 header.b=efebxuxD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbiIFLk6 (ORCPT + 99 others); Tue, 6 Sep 2022 07:40:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbiIFLk4 (ORCPT ); Tue, 6 Sep 2022 07:40:56 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95D1E32EFA for ; Tue, 6 Sep 2022 04:40:55 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id v4so10358771pgi.10 for ; Tue, 06 Sep 2022 04:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date; bh=zLIlU5WRN/qpc/luGxAkx8MLhJShGTdf13t85Wt12A0=; b=efebxuxDyVJ+HBbIqVJTWYN02z371rCOW39ThMtiUrXxkRMJo5y/R4IW1BYsezfxSS dbLo3aDSWkZ3buIgH+W3V5FWYp2pLQrP84A9O/3bqK0cBaJgprHqFt4M9rSCiuYnc8y3 HV4TEsnNjdQfhpOS5WDRHL8LjiNUJ+fb35F1iaP7DKi0iFru3xhCW1MrbGap/jeziMOC Q27Zn4X0fkLEZZcDsKhGzrPqWiGm83H1t04PrrvGeXZi+sHtRhUPR/RCFyCav6oPRloM +NWdQcmIzaUzI+ZuE7qcgXc6Pb6rS5Q8luniNlANvY84IC0P3XQjO7WTnqLBUdyUtIlJ VUMw== 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:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date; bh=zLIlU5WRN/qpc/luGxAkx8MLhJShGTdf13t85Wt12A0=; b=eNrsWQHz47mjqgqPrHpuTUVc5l2jtNCmA6/yWQhpUxUfMak8+W0LKlUczk4s1KB6Fy Faq+Wt/nCKYQKMfak12J3qpff8+qE+Be9RhD0wZNq84S4Yv+Yx62DHQFj1N7ipNXJZTm KXGrqZfiD7PYVYOhL2OA7HCmm1zKUetN6vdMlREXfpthiwTUQLOtL+OR2w5OEx9Fpqoy R+UhiodlVwSyIMZ66kbMGTPXY/QJ5pX3CFnJpJdZ7GGxqq0GnlvCuWU162ozCU/RGn3P JSbpypYH9lZhiOEyyqUkXYWVeAsLBt2Vok7+CuzwVzANU64kpEHJ+KjkvyGuJLkI4vj5 g5Ew== X-Gm-Message-State: ACgBeo1h5p9oPoXkikAydEeP0QGRmGzOtlO9udo5Xl79twVDIgUQRY8K Xq2KzmujRDxsxmo0i8TeUK0= X-Received: by 2002:a63:1624:0:b0:430:c45:eb7d with SMTP id w36-20020a631624000000b004300c45eb7dmr27857067pgl.42.1662464454999; Tue, 06 Sep 2022 04:40:54 -0700 (PDT) Received: from localhost ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id 6-20020a620606000000b0053e3a6f7da4sm1197954pfg.12.2022.09.06.04.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 04:40:53 -0700 (PDT) Message-ID: <631731c5.620a0220.8387b.1974@mx.google.com> X-Google-Original-Message-ID: <20220906114051.GA337755@cgel.zte@gmail.com> Date: Tue, 6 Sep 2022 11:40:51 +0000 From: CGEL To: Johannes Weiner Cc: akpm@linux-foundation.org, tj@kernel.org, axboe@kernel.dk, vdavydov.dev@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgel Subject: Re: [RFC PATCH 1/2] psi: introduce memory.pressure.stat References: <20220801004205.1593100-1-ran.xiaokai@zte.com.cn> <20220817025945.GA84631@cgel.zte@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220817025945.GA84631@cgel.zte@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Wed, Aug 17, 2022 at 02:59:48AM +0000, CGEL wrote: > On Wed, Aug 03, 2022 at 09:55:39AM -0400, Johannes Weiner wrote: > > On Mon, Aug 01, 2022 at 12:42:04AM +0000, cgel.zte@gmail.com wrote: > > > > This doubles the psi cache footprint on every context switch, wakeup, > > sleep, etc. in the scheduler. You're also adding more branches to > > those same paths. It'll measurably affect everybody who is using psi. > > > > Yet, in the years of using psi in production myself, I've never felt > > the need for what this patch provides. There are event counters for > > everything that contributes to pressure, and it's never been hard to > > rootcause spikes. There are also things like bpftrace that let you > > identify who is stalling for how long in order to do one-off tuning > > and systems introspection. > > > We think this patch is not for rootcause spikes, it's for automatic optimize > memory besides oomd, especially for sysctl adjustment. For example if we see > much pressure of direct reclaim the automatic optimize program might turn up > watermark_scale_factor. > The base idea is that this patch gives user a brief UI to know what kind of > memory pressure the system is suffering, and to optimize the system in a fine > grain. It could provide data for user to adjust watermark_boost_factor, > extfrag_threshold, compaction_proactiveness,transparent_hugepage/defrag, > swappiness, vfs_cache_pressure, madvise(), which may not easy for to do > before. > > It's not easy for automatic optimize program to use tools likes bpftrace or > ftrace to do this. > > While we may use CONFIG_PSI_XX or bootparam to turn on/off this patch to avoid > additional footprint for user who not need this. Hi Do you think this is praciseable?