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 B9B43C43334 for ; Thu, 23 Jun 2022 17:04:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3FC8F8E0166; Thu, 23 Jun 2022 13:04:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AC878E0144; Thu, 23 Jun 2022 13:04:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2745C8E0166; Thu, 23 Jun 2022 13:04:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 174C68E0144 for ; Thu, 23 Jun 2022 13:04:27 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9C13A328B7 for ; Thu, 23 Jun 2022 17:04:26 +0000 (UTC) X-FDA: 79610124132.25.1124B6A Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf18.hostedemail.com (Postfix) with ESMTP id E4E441C0096 for ; Thu, 23 Jun 2022 17:04:25 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 97DB721B7E; Thu, 23 Jun 2022 17:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1656003864; 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=x9l3R+KX6WOeiyi1xAcT40XEOunRcwBBALV27Yv1S0I=; b=G2RfLflEoRnPfoa30BJzXST0CFeNzcKVmLSbuIwKMxDfMqVJeIrICEvbv+cQ3YhYXyigp6 BQqFOlQCFnxoJJ+VJv5ba4MclfCF/DVVoAxHCMmXkwMqUFyqfD8ZPUz5xlQS0d0qb0/JLN yrCJLNuSpzjv5cxbu0JLs8L+u9gXY7E= 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 BA9A52C197; Thu, 23 Jun 2022 17:04:23 +0000 (UTC) Date: Thu, 23 Jun 2022 19:04:23 +0200 From: Michal Hocko To: Shakeel Butt Cc: Yosry Ahmed , Johannes Weiner , Roman Gushchin , Muchun Song , Andrew Morton , Matthew Wilcox , Vlastimil Babka , David Hildenbrand , Miaohe Lin , NeilBrown , Alistair Popple , Suren Baghdasaryan , Peter Xu , Linux Kernel Mailing List , Cgroups , Linux-MM Subject: Re: [PATCH] mm: vmpressure: don't count userspace-induced reclaim as memory pressure Message-ID: References: <20220623000530.1194226-1-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656003866; 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=x9l3R+KX6WOeiyi1xAcT40XEOunRcwBBALV27Yv1S0I=; b=pX5Y72tH2qi8psL0AJtd5opGZMNz5EoWE6D+ajoVyY4fu0+guqiGsJBdAbMulw8rcy9Rmw Rpf0WIIeRABGQB2tNkRyaYNCnPOLuNOip4yiaAwGqwVdWw1gXjGO6+GmTQP67zXmrwN+Ah +Ge0LWThb3Ij1ZuHp2+9APtTuxQnquQ= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=G2RfLflE; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf18.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656003866; a=rsa-sha256; cv=none; b=KPrzHQgWqPWB7eHTbcCo9pKVp3h1s+xVU3btn+ChD5q6pJFh7RlGDiMcomsIZx+HdG1YOK lAZYBbQoyAL6BPFy8OY4nG6fln0HY8NbpIQ/WeSXLbXkq5XfTe8thxA5y9odGABVxt3NmP gYGe22rYgPb9TJfFRP6fCBn0/CdI8oE= X-Rspamd-Queue-Id: E4E441C0096 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=G2RfLflE; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf18.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: msbekhybsrtayboy9kn6pyghqti43kuf X-HE-Tag: 1656003865-938589 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 Thu 23-06-22 09:42:43, Shakeel Butt wrote: > On Thu, Jun 23, 2022 at 9:37 AM Michal Hocko wrote: > > > > On Thu 23-06-22 09:22:35, Yosry Ahmed wrote: > > > On Thu, Jun 23, 2022 at 2:43 AM Michal Hocko wrote: > > > > > > > > On Thu 23-06-22 01:35:59, Yosry Ahmed wrote: > > [...] > > > > > In our internal version of memory.reclaim that we recently upstreamed, > > > > > we do not account vmpressure during proactive reclaim (similar to how > > > > > psi is handled upstream). We want to make sure this behavior also > > > > > exists in the upstream version so that consolidating them does not > > > > > break our users who rely on vmpressure and will start seeing increased > > > > > pressure due to proactive reclaim. > > > > > > > > These are good reasons to have this patch in your tree. But why is this > > > > patch benefitial for the upstream kernel? It clearly adds some code and > > > > some special casing which will add a maintenance overhead. > > > > > > It is not just Google, any existing vmpressure users will start seeing > > > false pressure notifications with memory.reclaim. The main goal of the > > > patch is to make sure memory.reclaim does not break pre-existing users > > > of vmpressure, and doing it in a way that is consistent with psi makes > > > sense. > > > > memory.reclaim is v2 only feature which doesn't have vmpressure > > interface. So I do not see how pre-existing users of the upstream kernel > > can see any breakage. > > > > Please note that vmpressure is still being used in v2 by the > networking layer (see mem_cgroup_under_socket_pressure()) for > detecting memory pressure. I have missed this. It is hidden quite good. I thought that v2 is completely vmpressure free. I have to admit that the effect of mem_cgroup_under_socket_pressure is not really clear to me. Not to mention whether it should or shouldn't be triggered for the user triggered memory reclaim. So this would really need some explanation. > Though IMO we should deprecate vmpressure altogether. Yes it should be really limited to v1. But as I've said the effect on mem_cgroup_under_socket_pressure is not really clear to me. It really seems the v2 support has been introduced deliberately. -- Michal Hocko SUSE Labs