Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3536475rdh; Mon, 27 Nov 2023 17:34:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFI938/e4p37P8NbAy4kXp5f6UEohzDTPp/CBflQrP/RiZq/DptadHgq6SWMIemDYzyM2Ah X-Received: by 2002:a05:6a20:13c8:b0:18b:c96b:a433 with SMTP id ho8-20020a056a2013c800b0018bc96ba433mr12939473pzc.56.1701135298289; Mon, 27 Nov 2023 17:34:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701135298; cv=none; d=google.com; s=arc-20160816; b=qBfjmXFI8y/7qTV+OTU6dbP+/Qom71l1yNX2gnZuxA4JYTG6vCtW9YdNPa8aOuEvi+ 1V5+Fc2zWZ+j/BqE0hNoQYMZJFvNIk20+33xu6NX0T4/Kesy4gLCZwfmYu1xAvAcPVFV Xiw5+Brz7Xzp2dMrcPsGkU6u5h8NjqgRKI0e2p/a97JNkQlKEwTEOrxw+b/DC67v8nwP y+o0JKII4PJ5AJsLy5lFYUtxO3ce0855BmnOfrTlpPrSxaqjHnHdEg29/aFVBm/eMZ/d wEDAQ4U6v1BVnL7Qo0gQE3iOt+fJJS4yuhgwPWyfX+yI9Q7pYntxCc3aIOXD0DwaRFDH CskA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=vmwx6KQ+/4j8kPbdszaHdVxC9AAfV6o/z44vIIujQ5s=; fh=K9rEoWDMAWfXwhDkRRH3hTLfIbf9SOuugY+VGBQ0Q2A=; b=xKHTKVzEVnwP7TkLLAQReJkobkrI+enJHBsuC97TGQiZTRngxwTWa062gB5R5t2DcR /7mT0frHWMTBCBEQmF9htEp95v70mjiS9k9f+VeU1aqod/e38uai1FMYOWkSCzQ/sz3V Ng1ZnG6XSejlZLGAVG5Ju2vW6wc1zkn3MI32gxoHbZ/TE4lTlKu6g20UE+UjBbhoaR3Y apqGxSRpFhevgVHxkFF+zmSPuSN2yM7lL4ZDdtcvGp8db1gPEpwU7XwjDvzLWrIzSxn9 nEmQHMPYLQjSHYA2JsnrhbR78ONpNRisVrsPVMxuGTHmATSrfsrwybUGzCfSbGhi4uO4 j8/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HmgKH5xd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id 17-20020a630d51000000b005be1ee5dcd4si11265185pgn.492.2023.11.27.17.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 17:34:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HmgKH5xd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EB5E2807D9A0; Mon, 27 Nov 2023 17:34:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234280AbjK1Bem (ORCPT + 99 others); Mon, 27 Nov 2023 20:34:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231954AbjK1Bek (ORCPT ); Mon, 27 Nov 2023 20:34:40 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D5C8BD for ; Mon, 27 Nov 2023 17:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701135287; x=1732671287; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=Tl3AvovjiESLHonnvMLH73/h4wwAe/SrzZTRfaFMmQ0=; b=HmgKH5xd/5DYcScNM32p+BHtO/C9wCO6Gf4npkN7inGvunKxSmi9XVLp LC2mV23Z0xDLkRj9NBXTrNEXf9XNTLKDsTX4X1CtVLGXupSSJWA/sWctt Oj+SNaOyIles66JDqgb6t51jEv6d/3Xq74CYKw/ZlC6jyAR17PP/Eo69r Q6FaO68wfQ/QDQ8PgOAGDw3/4NHSUgXEfE6hvMcBniSpoEqfHTgsTugBd ugH7rIJsEekGPC+D20sXk+eY6hD+qzyt8KoBtE4pi87MWnWTdbL2gwcVc +Jy+9tapS/oNPIk2Maje+3xn/vbJwP3dASEreCZoL/ZwoaJGI1Qid+Vse w==; X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="389982082" X-IronPort-AV: E=Sophos;i="6.04,232,1695711600"; d="scan'208";a="389982082" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 17:34:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="744758293" X-IronPort-AV: E=Sophos;i="6.04,232,1695711600"; d="scan'208";a="744758293" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 17:33:06 -0800 From: "Huang, Ying" To: Michal Hocko 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 In-Reply-To: (Michal Hocko's message of "Mon, 27 Nov 2023 10:10:51 +0100") References: <32fe518a-e962-14ae-badc-719390386db9@huawei.com> <87msv58068.fsf@yhuang6-desk2.ccr.corp.intel.com> <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Tue, 28 Nov 2023 09:31:06 +0800 Message-ID: <87r0ka64v9.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Mon, 27 Nov 2023 17:34:56 -0800 (PST) Michal Hocko writes: > 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? If there are plenty free space in swap device, why not take advantage of it? If the page is in swap cache and clean, we can discard it when it is reclaimed, or avoid to allocate swap entry for it. -- Best Regards, Huang, Ying