Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2869765rdh; Mon, 27 Nov 2023 00:23:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEatEv9+btUdNuttJ9Uu0aY84xHcx7u1N1byK6XvgQpOgTMsSF8cvAk2eKeaIes7tsLW7Di X-Received: by 2002:a05:6830:1cb:b0:6d8:31fa:4df3 with SMTP id r11-20020a05683001cb00b006d831fa4df3mr169527ota.7.1701073402806; Mon, 27 Nov 2023 00:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701073402; cv=none; d=google.com; s=arc-20160816; b=TLmfdFj19b1c6+zVggKu7YSw4ug3jPgV5VWdc4MXWYInT+dP9HFghjzVDOsG8ix54z 6EosNrwVN3rYHJm0clg5EVPVbq2CJAA4Z02arkrcg3dJVu6jFoMXZxDCtGSz6eysE/Cu yk0sKl6p57OFMvpzxymIv4m9Wo1LJmnNSe4fs4sZxjdgiIGX/AivxfzwKlEDHskIgv7J TxpK5gW6U1KAyBWRkWMW+A8z/F7Ycv87cAQ3uU+urr1Y9WGbkznA/frrCHLsbE12S63f AzxSO8iblefluYUORRj03SffdFPOmr8theIao6KTZvj2TSaL6W8xHk6RLiOoAeR646ao 2hVw== 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=ULlkC8JeamsZgVSVjUJ5qxYE4uUQ1UkdpEJhpvbLANc=; fh=TWQ2VwBxf4lebjKdHip+2u7LITsnHt3NwTLKikbqYu0=; b=VmIhcWwdwD41Y5hGCs1qEzeqJ4uPRI5+HCfaTn2Xn71Erk2skCP7dGql70fBNatFKd h5tWevtCH9rMtmCaZYzYztn8eOkgFxhWK2Ga67QLQLETZzSqHnG5YXgOcRulazgf5IA1 cd3fAlDpLd3QIZu8B9tKdDIleGQLJR2RigaaDmipbDw7aP5oIm1tFWPrzoWlw+irxpap wxGHHxH3Qr7A+LEclNRZkunvgUFgzxy1jTKR0TuQljMxS/GVBvslsrrcCCK69QUUS7kM b4tpTuf7vqG26bL1uo2Mo/cH15GZBhEMVO3rbZdgW9wdk1EwPxO7BdEEAgHYLnMI2Heb j2aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="NriFqP3/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id l12-20020a65680c000000b005b3b889619asi9086808pgt.606.2023.11.27.00.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 00:23:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="NriFqP3/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 5D079808EE45; Mon, 27 Nov 2023 00:23:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232505AbjK0IXG (ORCPT + 99 others); Mon, 27 Nov 2023 03:23:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbjK0IXE (ORCPT ); Mon, 27 Nov 2023 03:23:04 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DDEED2 for ; Mon, 27 Nov 2023 00:23:11 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6cd8c3a9edaso574251b3a.2 for ; Mon, 27 Nov 2023 00:23:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701073391; x=1701678191; 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=ULlkC8JeamsZgVSVjUJ5qxYE4uUQ1UkdpEJhpvbLANc=; b=NriFqP3/gENU8LISWFAW3K8UTl5+c0ccEC6CHuavWHJb5l8k0yJtTbXXajuZs/jJx9 0C4/jKP60T7B8C0BubHFbcVEeRh0bxeqkOrQOQLsTuFhZPB5Qstnss2FC3lpnrrJp4yn DdGVJe/sdp76g9N1I0sdYIoBex4auBvoRZKwjYKkloRsGw9Ar8aNAp5Nrs6h9dR7ryFV JUul9mhml/dwRKqRoASpPE6z6HULTd2SLpmjVboynsSENQm+u09vNmEOHm1szCEcMlYp aU70V7DJ73tnHCQZMd+W4PRtgWeIQK5jlnNdlSuf13vNMZNDP4MWmkjnbGrMdSbQ1dcv LDYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701073391; x=1701678191; 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=ULlkC8JeamsZgVSVjUJ5qxYE4uUQ1UkdpEJhpvbLANc=; b=A+lrIHo/NPYspThMFPY25Emff+E8V+1Ptky4pMHthGP0l81RNwuGXhEMr/qKwWmskn pvHYxdNDKRzNk8KQrSzsLzYkg8DPdjJAReWs3qM7xjqAZoq76ODo5hl2T12cKUBOwXAI rvhP+cUC/ss7OcVNf9dAdefVO6K/PMYqOdKdkTWtC5AgnRLKWc1vPJugzkkDEc1h5mB5 AzKvPWTz8TydMHrr52aPK1ScHMw3j4JQQB0x/A1ekDfXm+vH4eofIuS2joWgCKSOe4UI p/bLWv6iqwnA5Rg3zv7Y60uCslanmFRmQNpwyYMPlWmozwk4A9lBvgpCkOsBovQw0To7 hZwA== X-Gm-Message-State: AOJu0YwynLJtx8u/aPX+Qr0lUvkPLx6PYofzzc6JEe7cn/HpcCvngchj wHAKQbOXTzJ3pPthzSagX6yLF9I55D2zhpGA/bKZag== X-Received: by 2002:a05:6a20:144b:b0:18c:382e:48fe with SMTP id a11-20020a056a20144b00b0018c382e48femr7511796pzi.15.1701073390581; Mon, 27 Nov 2023 00:23:10 -0800 (PST) MIME-Version: 1.0 References: <20231121090624.1814733-1-liushixin2@huawei.com> <32fe518a-e962-14ae-badc-719390386db9@huawei.com> <87msv58068.fsf@yhuang6-desk2.ccr.corp.intel.com> <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> <87bkbf7gz6.fsf@yhuang6-desk2.ccr.corp.intel.com> In-Reply-To: <87bkbf7gz6.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Chris Li Date: Mon, 27 Nov 2023 00:22:59 -0800 Message-ID: Subject: Re: [PATCH v10] mm: vmscan: try to reclaim swapcache pages if no swap space To: "Huang, Ying" Cc: Michal Hocko , Yosry Ahmed , Liu Shixin , Yu Zhao , Andrew Morton , Sachin Sant , Johannes Weiner , Kefeng Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Minchan Kim 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 00:23:20 -0800 (PST) On Mon, Nov 27, 2023 at 12:14=E2=80=AFAM Huang, Ying = wrote: > > I agree with Ying that anonymous pages typically have different page > > access patterns than file pages, so we might want to treat them > > differently to reclaim them effectively. > > One random idea: > > How about we put the anonymous page in a swap cache in a different LRU > > than the rest of the anonymous pages. Then shrinking against those > > pages in the swap cache would be more effective.Instead of having > > [anon, file] LRU, now we have [anon not in swap cache, anon in swap > > cache, file] LRU > > I don't think that it is necessary. The patch is only for a special use > case. Where the swap device is used up while some pages are in swap > cache. The patch will kill performance, but it is used to avoid OOM > only, not to improve performance. Per my understanding, we will not use > up swap device space in most cases. This may be true for ZRAM, but will > we keep pages in swap cache for long when we use ZRAM? I ask the question regarding how many pages can be freed by this patch in this email thread as well, but haven't got the answer from the author yet. That is one important aspect to evaluate how valuable is that patch. Regarding running out of swap space. That is a good point, in server workload we don't typically run out of swap device space anyway. Android uses ZRAM, the story might be different. Adding Minchan here. Chris