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 D7A51C48BF6 for ; Thu, 22 Feb 2024 03:28:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F7BD6B0075; Wed, 21 Feb 2024 22:28:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4803E6B0078; Wed, 21 Feb 2024 22:28:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36FA96B007B; Wed, 21 Feb 2024 22:28:12 -0500 (EST) 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 274196B0075 for ; Wed, 21 Feb 2024 22:28:12 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5A1F0140BF0 for ; Thu, 22 Feb 2024 03:28:11 +0000 (UTC) X-FDA: 81818006382.27.45FD7A7 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf13.hostedemail.com (Postfix) with ESMTP id CBD432001A for ; Thu, 22 Feb 2024 03:28:08 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708572489; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iDbEvQP3akLFLWFhq4PgKxbCKnfkChAdAKvJF2Aqg6s=; b=VDq5n3MXcTsXxOaAsSObLayuPD8rcN5kn/typvKjHeV02nUC4IOOaB20TbtScfyilOelSj I7qvSL77JpnZR/PyV5WoCFt+dHMcw/4RkWk3hY4PZYrpc5OuwZc/ZHUIHz/uCYrI3/Tw+k BtXA23p2ofW2FN6UGG74VjPiDHuHBto= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708572489; a=rsa-sha256; cv=none; b=qzhAT7COWbHLOA6iEJdxPhSqMxBPY/4m6lY8KsDearfTUrsOZrxsZQeUj2wZ+x5pj9X9J6 gabcOPEttJHJyRzEDLe5gBY0jRpoOWMlPy9pj1ji0oPtj/S3LUwuMi2r/Hi6jb2BUB2lBj ee/o+xDZQa6JXz/1V+/EXrF5FUD+lLw= X-AuditID: a67dfc5b-d85ff70000001748-9b-65d6bf41bf6c Date: Thu, 22 Feb 2024 12:27:56 +0900 From: Byungchul Park To: Andrew Morton Cc: Yu Zhao , 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: <20240222032756.GA71504@system.software.com> References: <20240208061825.36640-1-byungchul@sk.com> <20240216072434.GC32626@system.software.com> <20240221143013.d130b310a1306dfed0f6603a@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240221143013.d130b310a1306dfed0f6603a@linux-foundation.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJLMWRmVeSWpSXmKPExsXC9ZZnoa7j/mupBvvvy1nMWb+GzeLyrjls FvfW/Ge1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A yDcLyaRZSCbNQpg0C8mkBYwsqxhFMvPKchMzc0z1irMzKvMyK/SS83M3MQLDdVntn4k7GL9c dj/EKMDBqMTD+4DxWqoQa2JZcWXuIUYJDmYlEV6W8iupQrwpiZVVqUX58UWlOanFhxilOViU xHm9wlMThATSE0tSs1NTC1KLYLJMHJxSDYycySfm6XAu0u6JDZ/aenKVgMOpXwwmE5b+Ss6X 3XnhSSTfJd6cijzN6YqCPzPnrVC9v8v9fQuTvZn2SectVn1iK/+d3dDoFdn7kS972d2pU732 M/5bfWe+p/0T32Oh+oXL5A/a3JfcxPzy1byMd8a1r7cuX5oSm2ny70j5hfLdB163OM1i/nNa iaU4I9FQi7moOBEApnLRAlMCAAA= X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: CBD432001A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: jcwszbs6jf19aqrnpksx3osnhounodbd X-HE-Tag: 1708572488-697891 X-HE-Meta: U2FsdGVkX1+yba+iyKaXvI2qvnVbr2ciDcwUkqYxQgSxBhLGpdp3iRftp9R+YWrTUkGFk1yFlWyDuqwONE1QcCiNCycjLo1T29GKD2wnWUvggaS319u7J8YyOMEb9fF7Sypw2hiip0Tz6Scwz+0gRyR8hVQktXxTmU0jeIBBeL5mcR1mpMXIzvOg2OGHspnSF70vQdBe/rIf/kRO8xcU7USTirxGvv4ocYuyBCEXHcYozsGrLVK4j3UF6YWWFwGkod6VHXZIrX5Qpt/TBzb4NOFErC7HBb+71raDewLJcFlhHvfUe03lyaOu4gsfmS8ZxjYcE8BFXvEWLqBCjsGDP4Rx4UpNZiVV+NDzfwm8r+y7bfSGO6MKNrINDZLWsKtJp6xhTIrUdiVAp1zQWSlw7W6oiUeAAQWMU/k+KChrpp03P7qYkcX72Fyi3HxtcbxDJ53+AiH2RVpTwKG9wB8BhU9khIH/1jtAFgjmMyWIgpwncFHF4V1ORF0QU2m2nnBJAvNYk0tNO3k2w8x1Iyq6bVPYcMZyJ9mKmlX/wkIy+e4oiPPb9Ok5PCaZfaUR+PIBzRcQ2cGCYTl3bxz1KE2gSfJJekiUBtMXx0f9bvpKRiOxed3UOsywnJsUoIf2AtaY3g/q5TN1uKA7xN6RH1eK3hYW2cysck6cZnijcLmbmY+YIGYi5UvbLrwD7N6vsEnyHVglks/iaR8EVBlGTt4bBw== 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: List-Subscribe: List-Unsubscribe: On Wed, Feb 21, 2024 at 02:30:13PM -0800, Andrew Morton wrote: > 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? Yes. kswapd stops its functioning. Even worse, after being stopped, any request to wake up kswapd fails until ->kswapd_failures gets reset to 0 by direct reclaim or something. It's more like a bug fix than a performance improvement. > 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. I will post v2 with vmstat numbers between before and after. Byungchul