Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4192177rdh; Tue, 28 Nov 2023 14:45:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJ7m/CpXuGDQ25hRvSvZeDShKPwaczbbzs4ZDDQX6qw3bUfA3pNuesyslLDihJfpBZoq7P X-Received: by 2002:a17:902:ba94:b0:1cf:d4c1:e26 with SMTP id k20-20020a170902ba9400b001cfd4c10e26mr6509400pls.59.1701211522761; Tue, 28 Nov 2023 14:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701211522; cv=none; d=google.com; s=arc-20160816; b=TcbTGgaZUsBRS44ZAlPcbSVZl7DQa4ydsAIEeKN2AhxIh+ZvhzVq1k5sDnJQZUqR7R De3YxPJLfjaQ8F5/GOCf/9X5zPHTJ/Zk+mqasZwPIhFU81TN8YNwVP24XWzCCZmQ1JYF MVWqd1GEpRfnsB9Weeyv5oWMCk2nYKYbPlGbBQHiPFuTisUfzmTkrv7B2kZgh08pfn3z hO3YmtP0i9pUoaXnMrGeZ7vyuWxUbRMdk9StHzwhs73yqAgLul5mZvzqwgdhrfaJQl0f JwUAON2kCNRrzgerwjkawTshkvoWsFCUvjmUV2g/uilTbJtBABjDxmtVaH0Nlf+LpwbY lvwA== 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:sender:dkim-signature; bh=yIxntpUV6An9T30/OVvCRNL5HGOjDnXv5bkE+BdjPrw=; fh=zWEYaQ8fiajB9NDMCPdIVP5x/REax0NB+xkoPRmplnk=; b=IAEEq/sM/knVf3p9rGO+TnBWtg+FhIC9Yk/xA6bB9fSRQsx4uMMsnDYKxr5Hns7wne itDdgCc9qw3oUEeIPV97sVwLSsLFzK7M0HDuVqD0DsPOJmKZBvPrVbqAwsMFneNul2da OAx/tPpR1JS9gMGcoBdMeUT+2uBeTb+M7c6tzsMAxXBHElCRu+2UEN/yMVbUZWHvQyiu U4RqzryL2loOmNvQkWsGzRsrH9CKtfY42Oc2/vW08K6SdWx7Wf04/pPrwP14H6qz44gv wLscCopSwxVLx1XQOvLBH6dP/uq4Ij99rY+BByTVDIbH0BqpHRI9xJ8wws6h8VfYs7r8 H43g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Vfim6XvY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y11-20020a17090322cb00b001d00553568bsi1466903plg.373.2023.11.28.14.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 14:45:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Vfim6XvY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5C455804BDE3; Tue, 28 Nov 2023 14:45:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344914AbjK1WpH (ORCPT + 99 others); Tue, 28 Nov 2023 17:45:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbjK1WpG (ORCPT ); Tue, 28 Nov 2023 17:45:06 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 073181990 for ; Tue, 28 Nov 2023 14:45:13 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1cfae5ca719so33804995ad.0 for ; Tue, 28 Nov 2023 14:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701211512; x=1701816312; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=yIxntpUV6An9T30/OVvCRNL5HGOjDnXv5bkE+BdjPrw=; b=Vfim6XvYZDA7AzQGfMvJ5knZHhX+viyOQ3XAOs95Q4yqtyMCcySt/Y1KH0SlFdP+Q9 1M8QG0ql2JWiG/FtfaMIpPwe95u2UDRwVrHxA3+6T5a5rORJXJI5vIjIg/wwFUbBKOqI arA5KUaE1Px/q44krDUE9PQOFe6KVazDUFmZs+noYVMSJBcPSzNQVyGNLeEro/AkifnZ ZQ4BwqgRY9QxcwSLvlKQ6Kci1N/4coRXFoggWJl6E3qlYyCtOP2jKgBCwlRND3ZoL8SX 4rdqOZVZ1OI1po6UVLs7hbAS04CyRYxOHA18UlTG41JZbvwOuOXIcP6aULYNcq51KwWu dwjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701211512; x=1701816312; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yIxntpUV6An9T30/OVvCRNL5HGOjDnXv5bkE+BdjPrw=; b=qYdjxWA8SXHK2poSKSUwF8W2cqb5qxjJ6hxPArihAIBdOCq1TcZqRLun1NY419ejRv N5y8YDFfgldUcn7lRV91I8UWtSjYtMEsSG1eMRgWA5dCu2vDE7zr1Q0vSSOdFNdYNEnS zQbn9dVJZFLxfqN23kC9gyfdgW34zBvqRwlHrkpIJi9fTj6tq7dXP7QaiYvX2KL7Fnpq z5ErT6hx4n7NzmaDadozpKxMAY8p546iC7o1WpLhKebJYcU01csRhdgBShECa0EPq8wJ FzHcEnuzKVuJ+F/FAyIZIKU8AyAfpKbZtyjRItoQI2YWTZ0TkCyez/henVnHc8dF4E5b qklg== X-Gm-Message-State: AOJu0YyAl6/k8z5wXT2oiQ/ONdOMOdTglkwQ0qHVvzcRpoexxv7fYfWt 4Zqi79ou23sGO+aWVUXSCsI= X-Received: by 2002:a17:903:2345:b0:1cf:d8c5:2288 with SMTP id c5-20020a170903234500b001cfd8c52288mr7795170plh.41.1701211512355; Tue, 28 Nov 2023 14:45:12 -0800 (PST) Received: from google.com ([2620:0:1000:8411:8fd0:78d2:c604:3ac8]) by smtp.gmail.com with ESMTPSA id f11-20020a170902ce8b00b001cfb971edf3sm6679898plg.8.2023.11.28.14.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 14:45:11 -0800 (PST) Sender: Minchan Kim Date: Tue, 28 Nov 2023 14:45:09 -0800 From: Minchan Kim To: Michal Hocko Cc: "Huang, Ying" , 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: <87msv58068.fsf@yhuang6-desk2.ccr.corp.intel.com> <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> <87r0ka64v9.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FSL_HELO_FAKE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 14:45:19 -0800 (PST) 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_free_swap > > > even when mem_cgroup_swap_full == 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. 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.