Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1307365rdb; Sun, 7 Jan 2024 13:29:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvrWR8+UX7QmfD0RYRNtvWsjVRXF5Qiw5dK/Opdj947U3VwGaG27BZ3HpCe3xyBLiFSCHW X-Received: by 2002:a05:6a00:3cc6:b0:6da:5886:843d with SMTP id ln6-20020a056a003cc600b006da5886843dmr3047791pfb.69.1704662971123; Sun, 07 Jan 2024 13:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704662971; cv=none; d=google.com; s=arc-20160816; b=ts2/a85rMEL2G0YQBThAXoFP7VHU1dHmHqVGx8XQReyjD70dnQBqJc3B3Dm0HHm/hc Zygnpt4CwwC8hKaK2Kkb6WrOATaxrRWOkFiwx1QYQa5E6h3+1rSqXOSqhwLlV69YnGax f+oQjkxkj22esTofM1OjT13f0jmyJiL3ezLfV8m4pl5/7jjMFw1cCd7HXk0V4WsX62KV Nl/Hw5oE0U7J6nwqTTxQL3t8Qnz2EaTSlHeI52RpFwRos+uJ9kh8aiksKFvZF+JLm7OI iQmoXlQSm3+ZgC9VS9vpQALVBGx/ieUaiRWGgIha7jQMhzgSrDyMZaKIETBP6G0ASX7h gF2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=w+A9E7kevV/RA3nngibl71YMsf/zK8ry/8PO6emuYBQ=; fh=KioSXyWv1fp35mR8uh7GeqH9RGKSBgCtPk0zydX12AA=; b=KLOu/ziLqyEtXgFBQJHrHVYATsF1dnDVT4a/Vd/QBXbNW4cqPCMegx7d4qNtBcuIyB Te26xLPZmmnYhB9QLRPH5JgBjIPI+IpTuJ2Jg0jK1gXP+eze58irz5LaJs8F6nc7Gao1 Dvs1HErI2WopNA4hBU7t9Ou6lPAetu2aRyqvOP6F8ej9Ms6IQNThqMQz2pbIDux13uQp 13GxaBgN/DXyCHYXI8wW3oj1HM9zh3v8Me/GvHo87HwHm7Oi48b/IV6rPHhUXUcqKd5L LH9ObcaZ+IabH+YU/Z4uwhPCcS1rKOp2ujxivYj5cXc7meD45fP6CNXOZ7ycIAD/f7Lb ZLuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eBzuJ8Ug; spf=pass (google.com: domain of linux-kernel+bounces-18991-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18991-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u70-20020a637949000000b005ce107e6eb6si5113495pgc.657.2024.01.07.13.29.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 13:29:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18991-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eBzuJ8Ug; spf=pass (google.com: domain of linux-kernel+bounces-18991-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18991-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7A102281A26 for ; Sun, 7 Jan 2024 21:29:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B6F41173E; Sun, 7 Jan 2024 21:29:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eBzuJ8Ug" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86DDD11712 for ; Sun, 7 Jan 2024 21:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7b913830d8eso75018039f.1 for ; Sun, 07 Jan 2024 13:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704662962; x=1705267762; 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=w+A9E7kevV/RA3nngibl71YMsf/zK8ry/8PO6emuYBQ=; b=eBzuJ8UgOZgqgSIK1unRUGuQHXMiTLjW45ECAEHDUAfX+rPDh62Abk2d7leMJUuRBY /cxDI9D3/E9ajNc18+RWdSqQnAbQUSvH01YUH1FxnL4/o/iqPCFAQa+5/y4AgdLUE1iR Z0BIYlGQYnt7j197EQTRItOzHotUz8726E6wrqJP3at/HvFw5rLx9T78d8vfm9d+vBN4 vCykAxs26k4LGHD8I2d2L8D+eleUsUeNQrZHNu56PKmNSP55d0f/sNrSOCdGZ/W9I03i WLslkql5SZyMkiCs5nXBtFb1GVNiLdcp956tZlr3NJtupR78AL2ibq+QUtue/b8C7TLj owng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704662962; x=1705267762; 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=w+A9E7kevV/RA3nngibl71YMsf/zK8ry/8PO6emuYBQ=; b=hRvwVCb2BMLU7RKnhFSnx7HfNJgKeGXOk/zYjrmh2OZQgyx+GgMmOupzFG6ktAmdtb yblIABTm5l3EaHcNU2PraOvtgAg2tNdN+MNZnFdCDCy8HW/jds2BYTsytnYlu9mKADgx 34G7zy6xcmTOxoPb+RqUKxz860OWwqVqJa/Hecj20WV6n8gz2kyjoqzDHIRsergwnc/T ICtw57T9Ora1P1WifayCyNO1JB6Uth95Pe5rI7hAlkn2evNCNkyZsJW9JQ4KzGhuTfOW KHnulHfvrfpCC1dvB3r8YlQLEEFmeD90SrbUMYseKwqtqJYIFHu2216+pCE1XY6LZfsV ez1w== X-Gm-Message-State: AOJu0YyHi//wpw3fm+QMwRtzLPmn/g3eZvGavShM7xx4V/OFqshdDTmg XtO0075RUbUhzuGhLA63p4p3lfsKpQHmlrO8fYU= X-Received: by 2002:a6b:ef09:0:b0:7ba:9a74:731a with SMTP id k9-20020a6bef09000000b007ba9a74731amr3555049ioh.8.1704662962484; Sun, 07 Jan 2024 13:29:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231024142706.195517-1-hezhongkun.hzk@bytedance.com> In-Reply-To: From: Nhat Pham Date: Sun, 7 Jan 2024 13:29:11 -0800 Message-ID: Subject: Re: [External] Re: [PATCH] mm: zswap: fix the lack of page lru flag in zswap_writeback_entry To: Zhongkun He Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, yosryahmed@google.com, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chris Li , weijie.yang@samsung.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 5, 2024 at 6:10=E2=80=AFAM Zhongkun He wrote: > > > > There is another option here, which is not to move the page to the > > > tail of the inactive > > > list after end_writeback and delete the following code in > > > zswap_writeback_entry(), > > > which did not work properly. But the pages will not be released first= . > > > > > > /* move it to the tail of the inactive list after end_writeback */ > > > SetPageReclaim(page); Ok, so I took a look at the patch that originally introduced this piece of logic: https://github.com/torvalds/linux/commit/b349acc76b7f65400b85abd09a5379ddd6= fa5a97 Looks like it's not for the sake of correctness, but only as a best-effort optimization (reducing page scanning). If it doesn't bring any benefit (i.e due to the newly allocated page still on the cpu batch), then we can consider removing it. After all, if you're right and it's not really doing anything here - why bother. Perhaps we can replace this with some other mechanism to avoid it being scanned for reclaim. I would cc Weijie as well, as he is the original author of this.