Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp719533imi; Thu, 21 Jul 2022 09:34:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sPcF1MT48/hpFiysWqI1dSmbD3Y0cPN4x5hxkgeRjf/k/veL8Dm2JrJPdStgJzgvKBIiXi X-Received: by 2002:a05:6402:28a1:b0:43b:a0d5:d30a with SMTP id eg33-20020a05640228a100b0043ba0d5d30amr16536737edb.278.1658421288781; Thu, 21 Jul 2022 09:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658421288; cv=none; d=google.com; s=arc-20160816; b=t49gpU4HKPZSf8dfzzevpMmqP4M5F3JT+5bnOXa5PsNDuAwrkq2XgJBfDVpx0clQP/ g8f5lCvZ8zThdqE+y/Y8LOTOdaQ2ClJ61Gnochl3o0w6876qw2i+6yTRG3mmS1VS0jT1 70aCFlkwWXW6+2OvjdJzgDBfqZNfYidz5/8CYZ6xXs9vk7P8NQwiS/CYX2+YsOmzndki PY30dYKqDIPC1tHYYq5d4RApZyQSfldYsWMr9GdoVhvYhsAgGLHu+ZGZPkWOWAIHnG8h EBSTQGHasVod+4shszFrxtYXYUI3J5utReAq/kDWnS4YIVOs1pvQVSFy+zZS67rkC/Au 1sDw== 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=swGACW5Jh2L0fPaTYT636BPQVQeKVon43dJ9BYyWHwk=; b=cTASG7gvv0ZU0dzNSLNqG0TYg3KcosGLq2GVQ07qbU2B9CYfTlQt2KC6HzBIne2cJa LFnCRK4ACcFPk9+9vU0GB3930zN/KiokA1J06AsHIPe6SpT98sKqaJmMGiaNf0u/C+Fa t2tU4AIx4Cz44yV6suJ/bpZnFA0cNfBjRjDynppXcqHWhxT+rHBTicWOIB8V80te0Nfo jHF0knZxqcj4w4lOrR8OhVbt+4m+OhNTyBSdojDSUraeTQ2tX0s2MQWSd+rT+h2Ts5Ya EOKnhrF+/GTroT2hpGlqBVx0656BjO6WaByvvr85ZaqtIhuAY9yoehMFWRen3VJap3wr 1pwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=r+w+mxLV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs16-20020a1709072d1000b007262adb2086si2201287ejc.256.2022.07.21.09.34.23; Thu, 21 Jul 2022 09:34:48 -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=@google.com header.s=20210112 header.b=r+w+mxLV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229547AbiGUP6t (ORCPT + 99 others); Thu, 21 Jul 2022 11:58:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbiGUP6q (ORCPT ); Thu, 21 Jul 2022 11:58:46 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D5477BE28 for ; Thu, 21 Jul 2022 08:58:44 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id b26so2923153wrc.2 for ; Thu, 21 Jul 2022 08:58:44 -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=swGACW5Jh2L0fPaTYT636BPQVQeKVon43dJ9BYyWHwk=; b=r+w+mxLV3pDF7H2PvRP1rSgfVNzPHjXRHDyW0bx0FSpYp1xxdfqRoM2olAqDztXFE2 PrymskSXxb/ztAY1MquHjtG0OPZHvYVoOyAxVVJizv2kBU3Q4X1K7qkH/BbNu30JXFtU jhWBX1Jy7Ww9lAN0MpXsAQhFSo5xgPmW7AAMUve3/2zmUkNLIZbDLkbOVMwQ42/Zvgxm Ti1H7+z6K/40JPEy9H0KmJ3GQHMbwo2S5TK+RhZh2SpFcwkIZHoA/HDnKg2724iqIleF GGmYpUbMNf8YGpByjFYxAiFmsiC7KoY1DCuYjnD3rpRD2ICk4RJIeYEkxerGu8ODGLx2 Oc0Q== 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=swGACW5Jh2L0fPaTYT636BPQVQeKVon43dJ9BYyWHwk=; b=65fk4nsaiXY2oh9ibJJKxM2Mnr09hB0tAe5Pi8CKFFoVFeeNDlWKKEJZP9Dopy36Jz 7xOMP83nebuWMDoUmN2ey4uegUL0EtcxUz3lz/gsI5/gKWKM+aR46W6saH+AaLMaAgkT 3mANiycbbGBN3l3dDRo9BITIbGm8hIMTJ1EcZtvaxiUYfa7POZ268wdA2aaKf3lXLXO7 DuVCwqYWGVSVqJdI5CzT6Nbxcz4MPXBc8G2lK223YkjrnlqQgUVasuov1JrUqL18sCg9 GMLOvInqiIS82p5mT9D63v56CLV5rHV4WugVQmS5ZN4eldgAFDlHyJJHPOaArGl45PB5 TTDA== X-Gm-Message-State: AJIora806VSUmvriWwXFVrmxmpQwdMSlyiE1HWRwFsig7FaLNK4Nv0KO G10xu6vdqDUT2aK1uot2HY6JCyCORzSt1TYhitB05w== X-Received: by 2002:a5d:588b:0:b0:21d:a918:65a5 with SMTP id n11-20020a5d588b000000b0021da91865a5mr35915956wrf.210.1658419122519; Thu, 21 Jul 2022 08:58:42 -0700 (PDT) MIME-Version: 1.0 References: <20220714064918.2576464-1-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Thu, 21 Jul 2022 08:58:06 -0700 Message-ID: Subject: Re: [PATCH v4] mm: vmpressure: don't count proactive reclaim in vmpressure To: Michal Hocko Cc: Shakeel Butt , Johannes Weiner , Roman Gushchin , Muchun Song , Andrew Morton , Matthew Wilcox , Vlastimil Babka , David Hildenbrand , Miaohe Lin , NeilBrown , Alistair Popple , Suren Baghdasaryan , Peter Xu , LKML , Cgroups , Linux MM Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Thu, Jul 21, 2022 at 4:44 AM Michal Hocko wrote: > > On Wed 20-07-22 11:02:56, Yosry Ahmed wrote: > > On Wed, Jul 20, 2022 at 10:50 AM Shakeel Butt wrote: > > > > > > On Wed, Jul 20, 2022 at 2:24 AM Michal Hocko wrote: > > > > > > > [...] > > > > > > > > I think what we are missing here is > > > > - explain that this doesn't have any effect on existing users of > > > > vmpressure user interface because that is cgroup v1 and memory.reclaim > > > > is v2 feature. This is a trivial statement but quite useful for future > > > > readers of this commit > > > > - explain the effect on the networking layer and typical usecases > > > > memory.reclaim is used for currently and ideally document that. > > > > > > I agree with the above two points (Yosry, please address those) but > > > the following third point is orthogonal and we don't really need to > > > have an answer for this patch to be accepted. > > > > > > > That's great feedback, thanks Michal and Shakeel! > > > > How do you feel about the following commit message instead? Does it > > address your concerns?: > > > > memory.reclaim is a cgroup v2 interface that allows users to > > proactively reclaim memory from a memcg, without real memory pressure. > > Reclaim operations invoke vmpressure, which is used in cgroup v1 to > > notify userspace of reclaim efficiency, and used in both v1 and v2 as > > a signal for a memcg being under memory pressure for networking (see > > mem_cgroup_under_socket_pressure()). For the former, vmpressure > > notifications in v1 are not affected by this change since > > memory.reclaim is a v2 feature. > > > > For the latter, the effects of the vmpressure signal (according to > > Shakeel [1]) are as follows: > > 1. Reducing send and receive buffers of the current socket. > > 2. May drop packets on the rx path. > > 3. May throttle current thread on the tx path. > > > > Since proactive reclaim is invoked directly by userspace, not by > > memory pressure, it makes sense not to throttle networking. Hence, > > this change makes sure that proactive reclaim caused by memory.reclaim > > does not trigger vmpressure. > > OK, looks much better. Please also add a note to the documentation about > this side effect. I don't want to add something to the documentation about throttling networking because it seems like these are implementation details that we may change in the future. I don't know if we can document this behavior today and then change it later. How about we document a more generic statement in memory.reclaim documentation, like: "With reactive reclaim operations triggered by the kernel, the kernel may take further actions to alleviate memory pressure (such as throttling networking memory consumption). For proactive reclaim operations triggered by this interface, the kernel may choose to skip such actions as reclaim is not an indication of memory pressure." Does this make sense to you? > > Thanks! > -- > Michal Hocko > SUSE Labs