Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4202288rdh; Tue, 28 Nov 2023 15:06:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+100y5dc6r/07mqNSll0b053O5YtRODIqnUrB9Zazdf1I9Ob24HYLlhj6zdZ2bhAagA41 X-Received: by 2002:a05:6e02:1e0d:b0:35d:13a2:7e09 with SMTP id g13-20020a056e021e0d00b0035d13a27e09mr4318687ila.6.1701212806588; Tue, 28 Nov 2023 15:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701212806; cv=none; d=google.com; s=arc-20160816; b=yhSeejeP3pcK555RNStjuCyCuwzR/okUXFBBHIL74L/FHVHemkjto3qQU3+V/kXf64 G6QjcsUyPQCbV8YcOjm1NAnV2UB9k7TNPuOOFYie3yrlhX+Bv3USygEMDVl0jUncIsEb UdFEUMJ4eVnQHdrV5/2oG1jD2JHfaMT0HTBrwtKUkGmEyan4HTJeyVFxIBHOjy2rhzWY MPrtpCCpLnQMGZHProd4gL5pcj5wh2k57GQPruLsDw9sUOiXQQ8AUsgoRTKJfZxNezfr ESces9eqZCsXL/XiNMO6X/FQETlvpFzJ0UnFykkwBvtl2yoD1qFw5cCMhYQdBmKQ1Kzw eXaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HlezK+L0MEYj7NA+OEHtCLMWF8WHQ+LQUZwspbuoAgg=; fh=8LztQwe1z8o9EVtZ6iPEj/52DtvyFXtfSId6hxwah/E=; b=bCkN7vj0ZqHxvbJbaBnxuDEoWUClklr+mTyTBKhSQAOY6YPkM2bEPJNfDYDKDw+EQS Oh3/UiTo5tKVDJeCcAIJSY2ftRI7DhbMtAZT9PpoqSLutbYV3qjFK41ijkTnOE6FxCKS isituer0Jm3PHVQw43nax7divmviHAyH1AxCBwv4fatYFlivyNn3KLW011dnFqtUANx2 qRiA0HJknwtjHw/SsVW+Bu3Tp8kbRZNEuCQdjkbzp0fpX9QbGHQHtxJb9qlknHRvPlDr I7815vINmdadz25776YopHq0m0mXScJZ6c3VyEUskTk7LRLCEFF232ktr/gR/CksRITJ +b2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="F/f3XSlG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s13-20020a63e80d000000b005c1b322b3c1si13152001pgh.681.2023.11.28.15.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 15:06:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="F/f3XSlG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 07A18807E428; Tue, 28 Nov 2023 15:06:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbjK1XGD (ORCPT + 99 others); Tue, 28 Nov 2023 18:06:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjK1XGB (ORCPT ); Tue, 28 Nov 2023 18:06:01 -0500 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9D51182 for ; Tue, 28 Nov 2023 15:06:07 -0800 (PST) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6ce2ea3a944so3955363a34.1 for ; Tue, 28 Nov 2023 15:06:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701212767; x=1701817567; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HlezK+L0MEYj7NA+OEHtCLMWF8WHQ+LQUZwspbuoAgg=; b=F/f3XSlGv/Ca0KM7IdFyg3+Z6uN0ZCfTFvPdgVchHxy/mR6lQn90ivZXQHWa2/k2Yh jJPBwss1O71yAv+KOBLuhs9iyIm+xFDYjDeOZhluExwICdcqIZiB3mlweMhRzKgf4LwL sum4QDHUgZ864Q0dNiMvqT72umnpv1aG5nfrZ/Y08gkHmZaiHDZji4sdeu+cg1vHTzH/ I0EzMqZZ+gbykH9vOM1yQzF9rPVxtwTTVPf38hGIP/v1i0EGYx4XIfla7A/UjGPiSP0M ySo6ztzOC5a5a4nJ6xNhcph61pW88bUeOFXdjT3lYtXcKb1W1MRXpMPH4B5SGf49Zv0Y Mo5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701212767; x=1701817567; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HlezK+L0MEYj7NA+OEHtCLMWF8WHQ+LQUZwspbuoAgg=; b=okB7uAzbXB4cgYb0CNbtlspWM8DiCP12yyPclghZjIu/tFj4oyhmi2eCeUxeEB7qBt 6IH/Me8uawbFVemiGv7vA8a4AmxmMN4B1H1CYMoZFS4BUIKZ70uLekuE1iARA1gswRx6 VSUZRMiwVPR7loc56ZKLP57Se2sMocelqba+m+Xi38LmuHjMxA91Uk1m2VaI+WXSvmcr h5ss8IqCtQmDJmYo+b74T8fYLf875VDC7D+ztP2hSOQLt0W9bnP4P9AmXSO0juXXIcM9 23jvPe7T8ty3ld1ml8KfVnTnU4Egpq0KhHFBXBVy79+wI1/IX0FivdAMhVpfTZJR99oD 3yvg== X-Gm-Message-State: AOJu0YxpiBS4bSkH4AGbrP3PLi/hPX+4bG/fz3+AOZLST4gNDGlNOuq/ dYw6Jo7PvN171w7oV1vrCBLBxoljWWrnl4/Qir99cA== X-Received: by 2002:a05:6358:2612:b0:16e:147:f018 with SMTP id l18-20020a056358261200b0016e0147f018mr18277338rwc.28.1701212766950; Tue, 28 Nov 2023 15:06:06 -0800 (PST) MIME-Version: 1.0 References: <87msv58068.fsf@yhuang6-desk2.ccr.corp.intel.com> <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> <87r0ka64v9.fsf@yhuang6-desk2.ccr.corp.intel.com> In-Reply-To: From: Yosry Ahmed Date: Tue, 28 Nov 2023 15:05:29 -0800 Message-ID: Subject: Re: [PATCH v10] mm: vmscan: try to reclaim swapcache pages if no swap space To: Minchan Kim Cc: Michal Hocko , "Huang, Ying" , Liu Shixin , Yu Zhao , Andrew Morton , Sachin Sant , Johannes Weiner , Kefeng Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 15:06:16 -0800 (PST) On Tue, Nov 28, 2023 at 2:45=E2=80=AFPM Minchan Kim wr= ote: > > On Tue, Nov 28, 2023 at 11:16:04AM +0100, Michal Hocko wrote: > > On Tue 28-11-23 09:31:06, Huang, Ying wrote: > > > Michal Hocko writes: > > [...] > > > > 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_fr= ee_swap > > > > even when mem_cgroup_swap_full =3D=3D F? > > > > > > If there are plenty free space in swap device, why not take advantage= of > > > it? > > > > Maybe a stupid question but what is the advantage of keeping around in > > the swap cache? > > If the page is shared, we avoids addtional IO to bring them back so > swap cache. I think this case is actually necessary for correctness, not just to avoid additional IO. Otherwise subsequent swapins will create new copies of the page, right? > > If the page is still clean on reclaim moment since swap-in, VM doesn't > need to write them out to the swap disk since original data is already > there.