From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31F5AC46CD4 for ; Sat, 30 Dec 2023 02:09:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 37CB06B012E; Fri, 29 Dec 2023 21:09:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 32D146B012F; Fri, 29 Dec 2023 21:09:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F3656B0130; Fri, 29 Dec 2023 21:09:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0B4846B012E for ; Fri, 29 Dec 2023 21:09:21 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id CE7DEC02EF for ; Sat, 30 Dec 2023 02:09:20 +0000 (UTC) X-FDA: 81621852480.02.17BC658 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by imf03.hostedemail.com (Postfix) with ESMTP id 485EA2000A for ; Sat, 30 Dec 2023 02:09:19 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aMLlkVAk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703902159; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=v8XkI2HPUOqTFI/0Hxh9G2qsgJP20uZIE0REz4LTieY=; b=PnymfhyxFgJpWu7eXj6zxECOwsI88ZJvCblSvuij++KvahNjUBcE8Q//Kul+lyMbqTUNa9 9UddwRrvT798oT5iFzLQEgCqVoHXd9pTQKiS+LlUNupf0y9degsFdTyvrjaBgTgGC9C5ap zVCi/Ae8bDinV9QFmmlwqNyfxCakhCY= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aMLlkVAk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703902159; a=rsa-sha256; cv=none; b=6NLDlEWEohM74ceyVkBCPv/Ot1xhsaPyaeMVX8zXVol6AK72F420oXjvULRza5Bqu3TjDw 2O2pqWV/AqjU91r/doQ/qGWaRxzFY5rxRaj+G8ypV2ZyMLzwHxxRBGAu47ZXU5T1kc+GQM K41aUGQv1n/a353zYo0rqdOY1FcnDMY= Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7b7fd9e17d8so342227039f.3 for ; Fri, 29 Dec 2023 18:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703902158; x=1704506958; darn=kvack.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=v8XkI2HPUOqTFI/0Hxh9G2qsgJP20uZIE0REz4LTieY=; b=aMLlkVAko/FuaUI8AklDZBV5cy7cJiQX2dPQ2bRylKE2pMxp9YDxw+3/aC5Hzwkvye ksyHIbqOVKp5ggmFtPGwQXnkeIHnOVuDptgy4nKPBFZ3aPKowY4TekPZCF2Th2UcujId QTUR0faE/ip955VaPVEPNmACiRW7LheVnaL0s9RLfMa8m4NvAlOIBSJ1DjgVZsuW+NT8 tGpZMZEleflCoESr7g5Bq0DZuj5OUyHP8+I1qirSYBH+mppDhBdofm9D6zbzoA8caMQb oV27o4XqedoRvUFrT5DGXQvpyiJMDkUcfRV31H25uNE/ufiY36ItnwhAlZhpWLIueKP4 u0Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703902158; x=1704506958; 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=v8XkI2HPUOqTFI/0Hxh9G2qsgJP20uZIE0REz4LTieY=; b=OdiKMhpt/S5qK8b6jDxfBxDqU5YEtJw1MvArnyJPf2XXCsQaXPjbaV8dpcVxjYaeCX PrBh9kxQ+4+RQhvPKd7WR8s+K2ieawoOV0OYX3Z+0KtEIY5hbhr3ju3WUYxi9i2XJit2 OmMMGxbklTDplCTmvfunSzpH+RTBcGCwMaHQTy1H6+LYfAa3cyM5+52PjVmV0q9rrnxz TomRNCvsRDBSesqhkLjIDJp4QsBMi+62djEof+DxPtmc3k4y1xk7QIAjlU8uY3jrgQja rOnsX7kFApP2gwkox1MiciG4fWxwGzVGNfQEXHW6GO3vbQQkemcZQGEtRgEm4VK25VVb 1r3A== X-Gm-Message-State: AOJu0YxscQrY84EJYjhpbRE4vIVdaTDbMhQxdh3KumypP1hWYAQc/ngW 3FxfpKOSzzQwLlbYi/B9ORcHSpOog+6PWr0hNDw= X-Google-Smtp-Source: AGHT+IF5IILgrO00XL7bX7RKZqUK08UZl0cQpfTyJEyxfIfytN2lx3xH2ltYaLpdzjT1STmA5+mEtcGkgeGA+jOTFpE= X-Received: by 2002:a05:6602:1242:b0:7ba:eb91:982c with SMTP id o2-20020a056602124200b007baeb91982cmr8180824iou.26.1703902158276; Fri, 29 Dec 2023 18:09:18 -0800 (PST) MIME-Version: 1.0 References: <20231024142706.195517-1-hezhongkun.hzk@bytedance.com> In-Reply-To: <20231024142706.195517-1-hezhongkun.hzk@bytedance.com> From: Nhat Pham Date: Fri, 29 Dec 2023 18:09:07 -0800 Message-ID: Subject: 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 485EA2000A X-Stat-Signature: wh86zqhigp3en88mimibyrmhfg35izb8 X-HE-Tag: 1703902159-532439 X-HE-Meta: U2FsdGVkX1+9+dAuvFkJEH4tHnNhBm9kV9IyPovbxY7AEfmK41LZGHBCfmFYgg6UF9OW4rsX2vUJNhYq3V8i1sKWhopWOEGDUtNn90uMEVpcEC4xUuwWMZbAORHwIiK5BNJDEEeFZo8p49YCl9Zms2jiJMt1dFHzvS56YjkvQJbDiroqgqrkYLu43kbJj1SH/fSGhgcMWhyl+CtBuswyoTQDVij9hoyR3g/5dlrs4UQPDsmMLzfojS3cYSFGGfk8o4ahzpmHLQuyk2oQ+NiiROwLu7WCtFeXOZm8bX2DoEEjWujVRXUE42ogOdq7Tgf1pMpcrd8TIzt0s142pExZGPY7LMOe5oLWvDRfic+oLnB0wLboXEorrHKocl6zsvoaraZ+fIHbngnvmTCbLCstnjBjl6iY5zy7WFOGcD1YWloXKOqtoV1Nu2rK7vEyqS9WbaEhA9XD+YqhKlbVpbY82EYhYz3o3z10/bcQdHcWt5CwjFcr0PGBYrAF0CkTWHPyP9B9xpHSXNCB5MURqUrZQZGaboLWLhi8l4BG6r+HckzIa+HxvMmo0xXv3iVk5K4CmbKLa+vbl5gzULgFgKG9TPsO86pcakSlbC9Q3k/kVs391JJbbOv7iF9JZR7Ln9c6DxexB/bGSYTxCm8Uoeffr3SsUh+H1JxOr4Ho896hdyiuqdTkA388AmR9z0lTPGORRpwNXPbJrphSlXd+/B4B0IN830Y5zIAYRrxffCOxnTVPx+ellFcU3V/vBWB8iHklSi3z0r1ZlWToXqk8XS4jQTM0CQzaZIJ+ND0f6dTzYStrQBSRoxuRexJ9mCCN//0FeXe1LYcCCgL6bGgOLYs+3zhyB2+T7NcQJ+ASd57tl8uVYxnfp4xv52tR7yvfysqv/d+qa1PXBcLZK/5AdmpplnfktyFWQyyOS8G9hwPwyGXTtRzPUWHa1YKWhEq+CpWUPKjlbB9LXqKeatgiXpf 94YzFWtp 3LH8KupDI77lXpb1qCgbeS+/ikDiKob59KGc9BaUfY7dbv2G9TZuj4QBMn687MioEalfOpcmMAHohgDQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.093754, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Oct 24, 2023 at 7:27=E2=80=AFAM Zhongkun He wrote: > My apologies for the delayed response. I have a couple of questions. > The zswap_writeback_entry() will add a page to the swap cache, decompress > the entry data into the page, and issue a bio write to write the page bac= k > to the swap device. Move the page to the tail of lru list through > SetPageReclaim(page) and folio_rotate_reclaimable(). > > Currently, about half of the pages will fail to move to the tail of lru May I ask what's the downstream effect of this? i.e so what if it fails? And yes, as Andrew pointed out, it'd be nice if the patch changelog spells out any observable or measurable change from the user's POV. > list because there is no LRU flag in page which is not in the LRU list bu= t > the cpu_fbatches. So fix it. This sentence is a bit confusing to me. Does this mean the page currently being processed for writeback is not in the LRU list (!PageLRU(page)), but IN one of the cpu folio batches? Which makes folio_rotate_reclaimable() fails on this page later on in the _swap_writepage() path? (hence the necessity of lru_add_drain()?) Let me know if I'm misunderstanding the intention of this patch. I know it's a bit pedantic, but spelling things out (ideally in the changelog itself) will help the reviewers, as well as future contributors who want to study the codebase and make changes to it. > > Signed-off-by: Zhongkun He Thanks and look forward to your response, Nhat P/S: Have a nice holiday season and happy new year!