Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2140906rdb; Mon, 20 Nov 2023 03:16:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFhGWx+oX1+firbWGWZtBG6B2J/rV+EuPpR1245xL17jTMHChdpuREpbtJ2/aoDmNbiz+R X-Received: by 2002:a17:90a:356:b0:27d:4ede:75b0 with SMTP id 22-20020a17090a035600b0027d4ede75b0mr7243230pjf.16.1700478986345; Mon, 20 Nov 2023 03:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700478986; cv=none; d=google.com; s=arc-20160816; b=TFzY0G8Idw79HV9Jt6REZgJpX59IPaG9ZJXBTmkrZ0OlPR4Jfc/4YrRVKBAz1gXWYU H3wZGHIv9IOUtv+BE9wmP61gS97syXfezz5z0lSOJPXbkFfFt0nRHI4eqxMKIPZhzYMg fViW9uovaKwRTcDnKUa/oWP2bVwCFpODFVMT1f06fnCJeV80mg4dTBqFIPrbiwNdp/k6 Sj0i9lxZfy6ygSxAmOrL3po/ajZdqFrR5AdDuJCUrBTkswY9WNCdbTjDgNBBW+WuAEkt EeAJiWEsOgwS80C9w34boC4ORxudcgXwq8O+8vaPjW8qLgvs+tQYpgLsjQHr7+52MrOz pOvQ== 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=haXSxEr8SHL2k7h4L7GLg+3o357Ly/kj2SV4CyscdCo=; fh=LoiutB1DzRAcGuF/vBlXxwq7aeAo91JWw1TuFponcEw=; b=yw4gSGz13H0s2mA0tXZDtAmFQrq62VUyqEeCMY052gUdOIru4OB9XOFCgR2cxun6VA JxWDrt7CdqQg951YswX9eR6e6ubKXxEi8YHyqsJn5pdLZbTjwFvmx41lDtUFucRktFJ8 4+VIowWx0Xh3qfM8WNdkTD+iM5O7w6DZI6K/VC+8D0BZUBAGtxnxf+u21E3NoVFmUGUE 9zTndouMscsMsrcsKro3jjDCMccPNnNzgAEz9oMDuJQlyGco8XPV5FA4bD91XxlDw07w X3fqyFaURv/0NvjWmUx8tZArZ6QTTajNgJ4aIQlms9xB1Xk2atRqxlDDQc8N5FsFtY05 xP/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=auWBk+GB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id qc3-20020a17090b288300b00277651787f1si8708290pjb.145.2023.11.20.03.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 03:16:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=auWBk+GB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CA9D180681DB; Mon, 20 Nov 2023 03:15:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233134AbjKTLPS (ORCPT + 99 others); Mon, 20 Nov 2023 06:15:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbjKTLPC (ORCPT ); Mon, 20 Nov 2023 06:15:02 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C315D9C for ; Mon, 20 Nov 2023 03:14:58 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c5039d4e88so55508821fa.3 for ; Mon, 20 Nov 2023 03:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700478897; x=1701083697; 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=haXSxEr8SHL2k7h4L7GLg+3o357Ly/kj2SV4CyscdCo=; b=auWBk+GBAfdH3quxbpBbsH8Teg4BRzXQEySBn3NgcDSadra129VoH5yx26A7//bIV8 uwJrO3pZjuJVQimtuAdhXpvy8Bcwc+bXKkuqO60GYuNwcJgVgXPiRPOxFKeHOLgTUvcf EGgFlStpeAbr1fFCUlrwaPTYmvpAYkC9WC8q4p/4hjEY1phoWKvJj/mKAJPmnNuHw8sS 47Qdk7md6njIfPMFkXGwgnwKd8v4JuGwSl3T5m8IxOs5NP9dLkNHeSMWlrkMyH3uWRH3 AbMgQ2gGqfkAxn8ySSRbrHC7reHg8gimKDi8mNHSI6pMd+syWx1JzLdp5a1ao+59tFBX yk4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700478897; x=1701083697; 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=haXSxEr8SHL2k7h4L7GLg+3o357Ly/kj2SV4CyscdCo=; b=H3t7lgc9Kx117A1rLmW9EpS6jHt2kd7pmz0v7XluNCyvLf/Wm1C4novS8s2ZardDs0 ovfOCUSoulcxNLY1+J05WolsgrkOWW1BtNBv6KgDyzmq7pFNFnArbpQF8si3VszsQawS PGYSrbMFNoKs4LTpqadhWrpQ3VXwqOzDEFr0dT9oe3vVv2/Qeso6LsMYGeXF1VJBoh58 F4OB3X0AfmLg9dWZb1kp6bjXEaXCmnAYAANv2zyGapuoi6eRMg+s6Yxd82Xkzx1qJt2u OAXKm5+X7TJV78t9OB+AthQ20MTsRHRzZaaMqZYirkCv1MFkfzGpAuGA4WKUY3dNmYpB wJKA== X-Gm-Message-State: AOJu0YwCfGuv/ia+UauHGb5zEDM1itmdMUsFh3SmtStYDon7+vA8OhEl jmsWdVw2clufxhz3g/+Tdb0K6xmV5HKz8VUCDTM= X-Received: by 2002:a2e:2a83:0:b0:2c8:2e3a:e974 with SMTP id q125-20020a2e2a83000000b002c82e3ae974mr4676611ljq.44.1700478896638; Mon, 20 Nov 2023 03:14:56 -0800 (PST) MIME-Version: 1.0 References: <20231119194740.94101-1-ryncsn@gmail.com> <20231119194740.94101-4-ryncsn@gmail.com> In-Reply-To: From: Kairui Song Date: Mon, 20 Nov 2023 19:14:37 +0800 Message-ID: Subject: Re: [PATCH 03/24] mm/swap: move no readahead swapin code to a stand alone helper To: Matthew Wilcox Cc: linux-mm@kvack.org, Andrew Morton , "Huang, Ying" , David Hildenbrand , Hugh Dickins , Johannes Weiner , Michal Hocko , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 03:15:30 -0800 (PST) Matthew Wilcox =E4=BA=8E2023=E5=B9=B411=E6=9C=8820=E6= =97=A5=E5=91=A8=E4=B8=80 05:00=E5=86=99=E9=81=93=EF=BC=9A > > On Mon, Nov 20, 2023 at 03:47:19AM +0800, Kairui Song wrote: > > + /* skip swapcache and readahead */ > > + page =3D swapin_no_readahead(entry, GFP_HIGHUSER_= MOVABLE, > > + vmf); > > + if (page) > > + folio =3D page_folio(page); > > I think this should rather be: > > folio =3D swapin_no_readahead(entry, > GFP_HIGHUSER_MOVABLE, vma); > page =3D &folio->page; > > and have swapin_no_readahead() work entirely in terms of folios. > Thanks for the review! Good suggestion, I was actually thinking about converting more swapin function to use folio in later series, since that involved more changes, and this series is getting a bit too long. I'll try to see if I can reorganize the series to cover that too in a sensible way.