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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1977AC0755A for ; Mon, 27 Nov 2023 09:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232733AbjK0JNN (ORCPT ); Mon, 27 Nov 2023 04:13:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbjK0JKr (ORCPT ); Mon, 27 Nov 2023 04:10:47 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8774A187 for ; Mon, 27 Nov 2023 01:10:53 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CC4D321B91; Mon, 27 Nov 2023 09:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1701076251; 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=zvMwrGsBjnXe9bI8YzhMj049OwPDHtYD5qQt/pXYQH8=; b=eGaGnJ54mrFpRwB2ko/RrgyZGa2+rJt3C8sjzD9OUPIeWTD5tjYQdSiULlwNt9gfTZNnir lmEDqN7KEaI5wAQ0Cw8PF9IhyxdxyDDH6IcBt1pLJaVP6J6qdW+hkIZ9se7+aFA+lNwCXl /gQ70/s+4xnaUsakrNZ5VLF50jjqsPQ= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id AE3771367B; Mon, 27 Nov 2023 09:10:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id lMWsKBtdZGVOOQAAD6G6ig (envelope-from ); Mon, 27 Nov 2023 09:10:51 +0000 Date: Mon, 27 Nov 2023 10:10:51 +0100 From: Michal Hocko To: "Huang, Ying" Cc: Yosry Ahmed , Liu Shixin , Yu Zhao , Andrew Morton , Sachin Sant , Johannes Weiner , Kefeng Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v10] mm: vmscan: try to reclaim swapcache pages if no swap space Message-ID: References: <32fe518a-e962-14ae-badc-719390386db9@huawei.com> <87msv58068.fsf@yhuang6-desk2.ccr.corp.intel.com> <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [2.14 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-0.977]; NEURAL_SPAM_LONG(2.17)[0.620]; RCPT_COUNT_SEVEN(0.00)[10]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.23)[72.66%] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 27-11-23 10:34:46, Huang, Ying wrote: > Michal Hocko writes: > > > On Thu 23-11-23 14:15:59, Huang, Ying wrote: > >> Michal Hocko writes: > > [...] > >> > Yes swapcache pages are indeed more complicated but most of the time > >> > they just go away as well, no? > >> > >> When we swapin a page, we will put it in swapcache too. And the page > >> can be in that state for long time if there is more than 50% free space > >> in the swap device. > > > > True, but why is that a problem? If you encounter such a swapped in page > > on the file LRU then the page should be referened and as such should be > > activated, no? > > This just means that anonymous pages in file LRU aren't temporary or > short-term. So we need to consider that. Right. On the other hand we could be more aggressive when dropping the swapcache. Is there any actual reason why we cannot try to folio_free_swap even when mem_cgroup_swap_full == F? -- Michal Hocko SUSE Labs