Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1675534ioo; Sun, 22 May 2022 23:59:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3rU+XkIissE3Tr8HlJYI2mxlyf8O6wB+2aY8aTlo0AIQV9wpv857UUPF2/pptVE/LUKdz X-Received: by 2002:a17:90b:180a:b0:1e0:302c:6dcf with SMTP id lw10-20020a17090b180a00b001e0302c6dcfmr8620905pjb.219.1653289182847; Sun, 22 May 2022 23:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653289182; cv=none; d=google.com; s=arc-20160816; b=wGlt+jlkG2V9jp0NbPLBoMZ/quYyGLw/NgOamX4t9MrVr3JFYtSoMCVbCbZz3zteXc Y2KIJEPjh9SnW8qvl40b+BqCMotZsIeqg2L+EIb9G0WgxSocgFyBtvKQyGvWATg0tush a3PQeWQ0oKdq2c/u3iYgDUzKnFunzSMu1cR72qxn44lnoCdWVzWpEEGrREaBe+mLOeWC YAYRgZHoJYo2TNqqDNqv3xQQ63zHYmfqgh68oeS5ASpiGM4zcpAnslWy7+NY5boYEKXR JC131OHPvK0aL40+ZxMtPsHyo6Q3052zDR8nKw0Cy62LHTyQMO4B00LgtUhbVjcX+s0P bV9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4sHh+aeOcshksAeWEKoIXMy64MvU5klwb4zgLRhptiQ=; b=GWP2L6iC0KGPeIOa4gXY709Fm8oHy2IS4yO9zCk5gZxH7rhTdOQ8L3Xpei3Tyw0c+c UfqIW9rgB29RqmQFQ/0Q8WaUmi2lG0d5Cd0hf/0JhBSOkwEeQ1Oj+OXmGw60pF2BAQ5M n6BeOBOftumlaJ0iOzSvJEffZvWfpXrxkKIgy2IawzbXJjsN0/uuuNFT9pNsj77UtvpY KsDjgCcRD2b+qcWWQNbnBTHWifoo+zyVN0QrrkZl6UkmXABKeeW/++IZXHLDvJ6NdfRj FjwVbExgJgjoZzKwIIbOiQ1vSr98u0Scicb1PQawr8cDnUcanbhaFcHHipaS6jz5j7Wn e5Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=phgG1zFV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e5-20020a170902784500b00161e5dcc680si7691334pln.358.2022.05.22.23.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 23:59:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=phgG1zFV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EEE095F266; Sun, 22 May 2022 23:24:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234204AbiESSew (ORCPT + 99 others); Thu, 19 May 2022 14:34:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbiESSet (ORCPT ); Thu, 19 May 2022 14:34:49 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9718056F90 for ; Thu, 19 May 2022 11:34:48 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-2fefb051547so65719307b3.5 for ; Thu, 19 May 2022 11:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4sHh+aeOcshksAeWEKoIXMy64MvU5klwb4zgLRhptiQ=; b=phgG1zFV85lfVsNRqOlr+jqMp71gt6ziGjyYLUM90kApzwoI3ReHJeVLTkcgWezVjx gVB7DMH9h0mBSpxc1/BQhfTOtgAyoK7sf6Nf3Mn8Jy+70R+fQa+6G/7S48XE1qo2kpOy U+y6b+r8NCjPB824HZfUKnodEa1yZ2vSLeMNUqKROIhqjIH4+ufXIzfm2S5Km+nHrk3q 2VqysAjw4rgxaLfPmG8vWXFghm7732u591qv51EvCe1UMYb6EUwfmDoP/3k4Un32bK1B 2vIR2hnSYAbE4fwcPPKWXwycuacHkZPR1GKD2cg4LbVoHhridUCWwHwSBCq0ddoDyI6X d4oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4sHh+aeOcshksAeWEKoIXMy64MvU5klwb4zgLRhptiQ=; b=b6jjIGtHMDxikhW38x54Zdse+ymP8hUzXf0BVtB3Lv5QQ810vq/dohqIsQ2hWU7bM/ IV4dD2+5ApdZthSsbpg3iqi+dG0nWoA0Plkb4aR2ecRqmtbV5Qxlxn6kkjBn9cUQjWau auQNWyrREkaqbwaGlaDGUIa+7EyW6yBk52xB8h8Q1kEht22QFWaLuDrihd1ZX7Jb7VCA 4D5u+fO4Y7jNRRGntWTNu/ee9wFKeeEop26ubfiXPl2uN4LA/Fteu8e/L06PJe6eFZ0m 97pGYKhzZdK07FFbxzKlhpYIaFNtrRjSeiMUg75SilWlHHbTdy4DFuQMW0FYEhY6qDAZ X0Dg== X-Gm-Message-State: AOAM5316VHW1+8PoeTuk+PyIOiQpCafMAjPk/oaW2aPYGpLTjRx7Lyhv C8NWkHiGYBtnBTFg8quKThexqxZMH1gkJMKWtYQDXg== X-Received: by 2002:a81:990f:0:b0:2f8:c347:d11a with SMTP id q15-20020a81990f000000b002f8c347d11amr5910848ywg.507.1652985287640; Thu, 19 May 2022 11:34:47 -0700 (PDT) MIME-Version: 1.0 References: <20220516033524.3130816-1-chenwandun@huawei.com> <30b37eeb-e77b-882e-fc24-3367321a8ca3@gmail.com> <3a31521f-a68a-b2a9-baae-9a458ee17033@huawei.com> <070fe87d-43a0-5e4f-e4c7-c44782c2c195@gmail.com> <29d66a46-d141-2d02-45dd-a8931786588e@gmail.com> In-Reply-To: <29d66a46-d141-2d02-45dd-a8931786588e@gmail.com> From: Suren Baghdasaryan Date: Thu, 19 May 2022 11:34:36 -0700 Message-ID: Subject: Re: [PATCH 1/2] psi: add support for multi level pressure stall trigger To: Alex Shi Cc: Chen Wandun , LKML , Johannes Weiner , Alex Shi , Jonathan Corbet , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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, May 18, 2022 at 11:15 PM Alex Shi wrote: > > > > On 5/19/22 05:38, Suren Baghdasaryan wrote: > > On Wed, May 18, 2022 at 3:29 AM Alex Shi wrote: > >> > >> > >> > >> On 5/17/22 20:46, Chen Wandun wrote: > >>>>>> This breaks the old ABI. And why you need this new function? > >>>>> Both great points. > >>>> BTW, I think the additional max_threshold parameter could be > >>>> implemented in a backward compatible way so that the old API is not > >>>> broken: > >>>> > >>>> arg_count = sscanf(buf, "some %u %u %u", &min_threshold_us, &arg2, &arg3); > >>>> if (arg_count < 2) return ERR_PTR(-EINVAL); > >>>> if (arg_count < 3) { > >>>> max_threshold_us = INT_MAX; > >>>> window_us = arg2; > >>>> } else { > >>>> max_threshold_us = arg2; > >>>> window_us = arg3; > >>>> } > >>> OK > >>> > >>> Thanks. > >>>> But again, the motivation still needs to be explained. > >>> we want do different operation for different stall level, > >>> just as prev email explain, multi trigger is also OK in old > >>> ways, but it is a litter complex. > >> > >> In fact, I am not keen for this solution, the older and newer > >> interface is easy to be confused by users, for some resolvable > >> unclear issues. It's not a good idea. > > > > Maybe adding the max_threshold as an optional last argument will be > > less confusing? Smth like this: > > > > some/full min_threshold window_size [max_threshold] > > It's already confused enough. :) > BTW, I still don't see the strong reason for the pressure range. > > > > Also, if we do decide to add it, there should be a warning in the > > documentation that max_threshold usage might lead to a stall being > > missed completely. In your example: > > > > echo "some 150000 350000 1000000" > /proc/pressure/memory > > > > If there is a stall of more than 350ms within a given window, that > > trigger will not fire at all. > > Right. > And what if others propose more pressure combinations? > Maybe leave them to user space is more likely workable? Ok, sounds like userspace can handle the situation of multiple triggers firing. Let's keep it simple as it is now, until we see a strong need or convincing performance numbers for adding this new trigger attribute. Chen, if you can provide reasons why a userspace solution would be prohibitive I would be happy to reconsider. Thanks, Suren. > > Thanks > Alex