Received: by 2002:a05:7412:d384:b0:fc:a2b0:25d7 with SMTP id bq4csp23551rdb; Wed, 21 Feb 2024 14:30:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUmz/UJAkeuQEXuJV6FvY/G/lTnMLShCEtS2d8XNP93GB9YgDllMj9HUjHwYFxUQzc3DahM8+ptx2dI5lGBNxmG0AQ+nT0gdkSX31TNrQ== X-Google-Smtp-Source: AGHT+IGMnBTVg3Mj2Oz58oXtUeHzcYTnsly50QAG7/WnxT6EiV4xvfITm2OUt4Dmne0DMAkznlDT X-Received: by 2002:a17:906:300b:b0:a3f:6678:d9b8 with SMTP id 11-20020a170906300b00b00a3f6678d9b8mr793283ejz.25.1708554632296; Wed, 21 Feb 2024 14:30:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708554632; cv=pass; d=google.com; s=arc-20160816; b=UeKa9HSmSBNruHlzYwOXG8ypwpcUFNTivrFq45ozToyXKUF/mET9kKf6x/f3r+9Yra tGWZdLn1iwM2+xiBBIlZF622/z0Q1rMPZYqVLnv+ri6xnREBKyRibWO6GsJm9FJpHHqW muO7bUvDEbtIHX7o07IBeyvBic7LppWnBnbdcKs0rkzyvzbuztj0farQKrrXS4Qn3pFZ C7nuEEIhOFZ/Ev20BgKRfxhLPFW8sOn9ZwVNBa67PD6Dn6QrfQwgti2rKwBH8+W84dWr zPWTF+K7jKnIrJwmi7/GjjrfFIP0+WnvpL9uoCclhxXWYX31+tWnb27iVyshiD1KFM8+ UEog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=m2XRvTZK7SAcYpfizhXRcsLlfXX2SRGEJbRRfoRM5Oc=; fh=U2Byb6Z5uZioeU+W/rKuR57xoNHDkVhYqF+qtQov21U=; b=nuT7TdStp4L2IkwIoSyFDXzwu4t9CJqKukMyl3ppbn6i4Ae6ty99PDahAp8BYCSd2f 0h2ZhEEfXs9Qdj8mbHB5zDtuNZxBabbLRWlu1m2geseNhy8qVuYiq0ml9gDxUyoA08jA 4ZZL1WzRUAFaCvEKvCtAi/HfVjT6B1yiFNmmnGnl/Crf6LIZtgnlamWqQhchuybLue4N aN9xJWjcme3EgIsO6bLUUnkP22cASLhg/78dTUrkf5ilS3T2S+e6cfr3prpN6e37d/6a 6lnSWEKArkM12XQnaxOU3/R2eJgGt9xNpRtDn9GvR0ajZVNh6xDpNgz8o3Ck7pIVv7Zq 1PBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IKSCSYPd; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-75602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75602-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id oz19-20020a1709077d9300b00a3f0e623cd2si1866391ejc.882.2024.02.21.14.30.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 14:30:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IKSCSYPd; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-75602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75602-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CE1D61F23AEF for ; Wed, 21 Feb 2024 22:30:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0E2C12AACB; Wed, 21 Feb 2024 22:30:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="IKSCSYPd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C44A6129A6C for ; Wed, 21 Feb 2024 22:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708554616; cv=none; b=FvWB9Ii14DhM/8WJLMlic0udQJTfbjI8VFe3zhz3Q7gdHwripb0UJw5+whrxm1plAq9lOlFNfI8eZOsG3+69g9RrYU6hlzuPmYH2yrRYHZ4KhcZaezOpn0HHZukWHH6Y6qWyavRyZ16TqsH3aNI+lxiDk59UiY6QDQvCa2bCtHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708554616; c=relaxed/simple; bh=GU7BcpQegK/Po/OrazsdN3umuvQx2U8gfB37BUk9oaM=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=eKjk9tHBEEUnRnQeVyj8Tw5Wp0fT7kaBq1cKjWhlV3Uf8dRDNaGxbTe5QRn2RlOHjpAFzWDC95dDLW1zxfgYqA7Hc5yxCl9XyXov2v0Db8mbNt3bLouxsgfAgizD8j9JjEPih3sZyeqjusenYD6gb4dqBHzft5VpTw1RVzeAwZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=IKSCSYPd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91630C433F1; Wed, 21 Feb 2024 22:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1708554613; bh=GU7BcpQegK/Po/OrazsdN3umuvQx2U8gfB37BUk9oaM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IKSCSYPdaXS3m4XBwaV529Y9WSat1k7rPJMU+j1OFvO+L2/5dr5bBeBIdjalBytpi TkqTHqaYMLShAITeks9Zs4m3aAUQFs2azGSu9G7UWUjPGjTQOQ4qelDkCrDUlTn+Ly SYmU/YF2+MdeLaGeAafH+HLapQtdF+8eAL/jrYDI= Date: Wed, 21 Feb 2024 14:30:13 -0800 From: Andrew Morton To: Yu Zhao Cc: Byungchul Park , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com Subject: Re: [PATCH] mm, vmscan: Don't turn on cache_trim_mode at the highest scan priority Message-Id: <20240221143013.d130b310a1306dfed0f6603a@linux-foundation.org> In-Reply-To: References: <20240208061825.36640-1-byungchul@sk.com> <20240216072434.GC32626@system.software.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Sat, 17 Feb 2024 00:11:25 -0500 Yu Zhao wrote: > On Fri, Feb 16, 2024 at 2:24 AM Byungchul Park wrote: > > > > On Fri, Feb 16, 2024 at 12:55:17AM -0500, Yu Zhao wrote: > > > On Thu, Feb 8, 2024 at 1:18 AM Byungchul Park wrote: > > > > > > > > With cache_trim_mode on, reclaim logic doesn't bother reclaiming anon > > > > pages. However, it should be more careful to turn on the mode because > > > > it's going to prevent anon pages from reclaimed even if there are huge > > > > ammount of anon pages that are very cold so should be reclaimed. Even > > > > worse, that can lead kswapd_failures to be MAX_RECLAIM_RETRIES and stop > > > > until direct reclaim eventually works to resume kswapd. > > > > > > Is a theory or something observed in the real world? If it's the > > > former, would this change risk breaking existing use cases? It's the > > > > I faced the latter case. > > > > > latter, where are the performance numbers to show what it looks like > > > before and after this patch? > > Let me ask again: where are the performance numbers to show what it > looks like before and after this patch? > > > Before: > > > > Whenever the system meets the condition to turn on cache_trim_mode but > > few cache pages to trim, kswapd fails without scanning anon pages that > > are plenty and cold for sure and it retries 8 times and looks *stopped > > for ever*. Does "stopped for ever" mean that kswapd simply stops functioning? If so, that's a pretty serious issue. Please fully describe all of this in the changelog. Please also address Yu Zhao's review comments and send us a v2 patch? Thanks.