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 EBF55C43334 for ; Thu, 21 Jul 2022 11:44:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DE308E0003; Thu, 21 Jul 2022 07:44:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48DF98E0001; Thu, 21 Jul 2022 07:44:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32E928E0003; Thu, 21 Jul 2022 07:44:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 246588E0001 for ; Thu, 21 Jul 2022 07:44:19 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E8C91A08D8 for ; Thu, 21 Jul 2022 11:44:18 +0000 (UTC) X-FDA: 79710923796.29.D69641B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf14.hostedemail.com (Postfix) with ESMTP id 7FD79100080 for ; Thu, 21 Jul 2022 11:44:18 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 80A01347E8; Thu, 21 Jul 2022 11:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1658403857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=55vVqyAoWIEQ9JxT7s6q3Jr0to6oOsiGEmqrmnmaNGA=; b=Io2AKFGB7/eGwnBd04xBVFA7h2OmtbDhJOT2cpLxov+xmrqhdkQIes+oEiybC/+hFQp4xH rsU9zD7wajZdjxY9q29OcYlhNkh0olliRmeN45oIkAz3wZVoMAeCL2y1/zzI8KG9k1Ymqg Q2NM9TA+/ZepPCtDQKEQZblHFcwxvyU= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 6AB622C149; Thu, 21 Jul 2022 11:44:17 +0000 (UTC) Date: Thu, 21 Jul 2022 13:44:16 +0200 From: Michal Hocko To: Yosry Ahmed 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 Subject: Re: [PATCH v4] mm: vmpressure: don't count proactive reclaim in vmpressure Message-ID: References: <20220714064918.2576464-1-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Io2AKFGB; spf=pass (imf14.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658403858; 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=55vVqyAoWIEQ9JxT7s6q3Jr0to6oOsiGEmqrmnmaNGA=; b=Qet+/43Mi+Qz72YyGC4XjhJpGRSb/+LSMvdYQ0B4sMejhw/ljXN5tBgc/L+Lrf0w6TBeCC LPSBH3n04BE9DrGZO1bAhAeF3HQUl/UObw2uUyFlLHZ0T/ODpFxLeXewfvinbWLlLXqmbq 8D7VFsPc3+r9JJYM+D+pvSK60xkEhm4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658403858; a=rsa-sha256; cv=none; b=MmiuvXslp3GXfBdRbr7EtIGrae/NLuvedCNewh65B4IHJr6i8+Gs1VJXDudfhzkQwdWPH6 oDyeineU8kZUPZYqpqjYLBUB0Vg88sWLj5Y2+YNlTF+HKUgmgs3UvSOVv5jgM+uALBX1+b 6sCI/HckFYbI1uw6rlBD30famsXmT7M= X-Rspam-User: X-Rspamd-Queue-Id: 7FD79100080 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Io2AKFGB; spf=pass (imf14.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Stat-Signature: y5qyni6yme6sq185cjhq4kgtkm68b6nd X-Rspamd-Server: rspam07 X-HE-Tag: 1658403858-688250 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 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. Thanks! -- Michal Hocko SUSE Labs