From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE9FEC43334 for ; Wed, 20 Jul 2022 18:03:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FB816B0071; Wed, 20 Jul 2022 14:03:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B4876B0073; Wed, 20 Jul 2022 14:03:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09ADC6B0074; Wed, 20 Jul 2022 14:03:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id F09FC6B0071 for ; Wed, 20 Jul 2022 14:03:34 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BA17AAAABC for ; Wed, 20 Jul 2022 18:03:34 +0000 (UTC) X-FDA: 79708250748.05.B4C8E24 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by imf30.hostedemail.com (Postfix) with ESMTP id 4E54380019 for ; Wed, 20 Jul 2022 18:03:34 +0000 (UTC) Received: by mail-wr1-f42.google.com with SMTP id n12so14372819wrc.8 for ; Wed, 20 Jul 2022 11:03:34 -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=2YSXf98rTw+aM6nqedJXsMdekQD67mGphdqXFvr1fbM=; b=dnV0YHWvnhuMUuSd57347+DOzR3AxQcrR7zzAGoWSmv8OwPuA4SNbmOO5Dz88dFjqy kls9OTarVd8bmE/zaV7DVW5OrVc2W6xDg9rvm85GE0fVrn+2S8m/4yEbf3pPxfB1qZKb v3sjYgyUFN3/vHk3+826GcexfrrE6GCpCZu4Q6Bn1efuiZU9eBg1uXRDZTJRXJx3UKbN 2zfN3FZLP1hZvN7KZrO1h+8oAIhvt5/VumAis5ShZIb7OCuHVOo5kkDLK+zwYpcXRfgC lQX0lzUNZpJW6zkqJ6iPyGtc7lQuGW3RZ6Ssly/XvZ0alzMjN4C6DqQBTB3InJ3Gmly1 XlvA== 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=2YSXf98rTw+aM6nqedJXsMdekQD67mGphdqXFvr1fbM=; b=3yAOes+Sdd8dmTnNBlZ9wxx5IE5ikrqyYexhxBdpyX8pKr3t7WWNUHL5G73/GF4GVa yrqWwmmX3HjEM8OUYNpA8wtM4fWX86uofE1KKudh35NzmmM/2OnWdQSx63KYNQ5t4dZM ADZZrdi1NaSf+FUEafy/qxtfHvKAbKIEjohro7C7p6aA+kbj6ka7Z+YLBQ9uUfL1CJCd EZsrzVE0OSxJGXwQcT2k6xG3i9ZyxkGNkHqTVpu0bwda4iH0Hz0BNHTRgHRWZ83NYLvp bjN/XDkHqaRbuBfd8FwRErh92/75V5bhysu4mdfc7S0dBKPWejC4dCO2lCoiN2RYipSp xvjQ== X-Gm-Message-State: AJIora/CvNPWblFdvkXCSRw6BMWRPQyTZgBuNQz+f9+8OsR1MUffhjAT 8jeCRiF6izoVoFTe4RUzg7v4sOQP02SbyQnF35amYA== X-Google-Smtp-Source: AGRyM1uFir/eG19aQ9wS4vWbQl35bcqmiCabGhXOvV9aIJvJ6VfH+DygWDgwwsRIhPPMb59vxOQgcxQvjcRrm1wgk54= X-Received: by 2002:a5d:5a82:0:b0:21e:2899:60bd with SMTP id bp2-20020a5d5a82000000b0021e289960bdmr9534113wrb.80.1658340212940; Wed, 20 Jul 2022 11:03:32 -0700 (PDT) MIME-Version: 1.0 References: <20220714064918.2576464-1-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Wed, 20 Jul 2022 11:02:56 -0700 Message-ID: Subject: Re: [PATCH v4] mm: vmpressure: don't count proactive reclaim in vmpressure To: Shakeel Butt Cc: Michal Hocko , 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" ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dnV0YHWv; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of yosryahmed@google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=yosryahmed@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658340214; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2YSXf98rTw+aM6nqedJXsMdekQD67mGphdqXFvr1fbM=; b=xn9FQL4dKHJlM0KIeXgtSUm4wq6JWMf9somwIbgE4kx96aB5SFZ5gjZtjIPME7MxeiksS6 nP8quNQEZBGvOYq0fEgvD+cRId3eSuL5T93PBl5njdLTzCHCEwQ7z80ibjxahfCmxHFu74 vJcmbktKafihpjJXLmGi3xaA7hURHNw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658340214; a=rsa-sha256; cv=none; b=8UgUseapG/CD8SLrYPc2tpMN1z+j9mPek834IzdOc5p285JifvHzS5CZ4dpHt1zezfuqW6 yYxqlFnUsN46LZeO0+78Jwd6GAzK4g/d6Db0YGqrvQ0DYshJaGvVnfIhOwFgyXeiwussx0 jKJvw1mAVUTpYUWjv7CqlL280dglYRU= X-Rspamd-Queue-Id: 4E54380019 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dnV0YHWv; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of yosryahmed@google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=yosryahmed@google.com X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: smaub3joy9netr7cwo4hw995cdmgfqwc X-HE-Tag: 1658340214-41005 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. [1] https://lore.kernel.org/lkml/CALvZod68WdrXEmBpOkadhB5GPYmCXaDZzXH=yyGOCAjFRn4NDQ@mail.gmail.com/ > > - how are we going to deal with users who would really want to use > > memory.reclaim interface as a replacement for existing hard/high > > memory reclaim? Is that even something that the interface is intended > > for? > > I do agree that this question is important. Nowadays I am looking at > this from a different perspective and use-case. More concretely how > (and why) to replace vmpressure based network throttling for cgroup > v2. I will start a separate thread for that discussion.