Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2892739rdh; Mon, 27 Nov 2023 01:13:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnQvCGlKWhrCRSlpQ2iVPmv5qE3W6AfuV+1tCWaFWZzVbXuhdqVyIsTsoZuo8PS8ciRkmy X-Received: by 2002:aca:d11:0:b0:3b2:e536:a442 with SMTP id 17-20020aca0d11000000b003b2e536a442mr11571850oin.16.1701076402597; Mon, 27 Nov 2023 01:13:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701076402; cv=none; d=google.com; s=arc-20160816; b=z/PgbVKiYpJ5ipxgZiBD8XUYieJdJoYdz2yohrVY3ZMInNJxTkGVxKnHMOkFttlrSa VRPFBpPNf0CZRVYI5BimikTaUv+vZqX19C7Y+ZsjGEyAqsTrK+XKk1R6OZTsL/xALNRz lwcbM+gTHMJqItIwA1UKUXz06A8atezcrhKgcQw105ZUiixNxw7+eaxFs5COuYBbLaK0 eozyKjGbt02fEVgX+n6CZdGB+Vwqf5iqhxb8E9REBTp9P0T5sjv0k0eBRSc8Pnvkpq4j dCAlHNajHKzF6n1ZJQSFknsnVf+PslbXP6S4NtXBiOzpHEDmfnMU2lo40VsfFUADdINn N+xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zvMwrGsBjnXe9bI8YzhMj049OwPDHtYD5qQt/pXYQH8=; fh=k4lQAAFbN0e4YvZV81IMKjuRMz61aFxf/iJ67sWVNlk=; b=UYDAYE1fovl9G4oTMYUxHry9vAFt8hbC5JWtS/MBlyxkp/A22QBAYSgOIgBtxlMXfU chEg+cwB886v5Oq1HMnS9HRh1r2P91TZiu5v0+KWRIbxd09PdoIKxHC08iSFw+BnhGz8 L/Sp9j3xcmMVMFYMd3D668ntNZj583ONsMKvDO9rBvYfg9PhynqNBnkcfnekxk64HsuI P09KPaY1BmqYXgGGKw0EiJkv1XDu6XpI8nYjMXpXEIHbWB9s0Yh5rH643mwf6hkIXsuI 6Ifix7mjKhF6Uf8a4g8p1eXgAON+kJ5rtOpS6IlJjj6/qGCHMJ2iwmL2Uby05PTJ11zL Y9sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=eGaGnJ54; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a20-20020a63e854000000b005ac4854b202si9298957pgk.321.2023.11.27.01.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 01:13:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=eGaGnJ54; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F414E80713E4; Mon, 27 Nov 2023 01:13:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231211AbjK0JNK (ORCPT + 99 others); Mon, 27 Nov 2023 04:13:10 -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-Spam-Score: 2.14 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%] X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 01:13:21 -0800 (PST) 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