Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1846982rdb; Sun, 19 Nov 2023 13:00:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHi7zmhtyTZ5Ej4OOXU8uCel5VaaXBGODerGeePbo6XtJ9Ey4CCpyb0bTOCdBCv2vyFu7gF X-Received: by 2002:a17:902:a412:b0:1cc:7f53:c190 with SMTP id p18-20020a170902a41200b001cc7f53c190mr6375109plq.51.1700427659013; Sun, 19 Nov 2023 13:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700427659; cv=none; d=google.com; s=arc-20160816; b=Sd9TGW+BeBVUk0Y/6ObsngjUaazViUW8f/rDUeApokKvYYy+ef4OjsHYmuv6YGDSK7 jg1WWINWq9WaprTDmZlTWr18OXIJo6leoofjqQWS0RJM19eC63TFyue5FBrVib6UDeuR Hoy+bvcbu83HnTuYfjolmtmuCM+6k8PWgeZVVJgOhy1WChO64eKWS+z7XZhb6M1DAg58 mmO0WLRdNpRaHY8g8tLKgT37wWmpOBm91szqGZhTY7zfbHmfPBRtZndZvyfxY1s9ecgL cy9/RV8SjWyH1ci2LQt87dna2UI86PxeKObe8zZnNEv5IcWJwzM1kawwXYO+hiltiHQD DxRA== 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:dkim-signature; bh=ewgYBVW+Iax6CqzUrSGGjtpzlAkAA8ZMF03lgMpKaIM=; fh=xtla2RzbqQcC9iS2w/NLQ5Gl8jt2MNg63K3u0HRJPcc=; b=Qa4nk/5JTiGJhI0bTvOd7eIgr44vIj6k8azGlotvSWEhXZ6Sc9H0PW3SPz9lNCpF7d u1wjol/6SpOY8C4+aWvTQAZzxC4pE35UXs3G5m8hMv8VdMJsQCW/+9/J+IcDv90+JtSJ aupYXigWLg7tmYbBlB5e2HlA/x1Ph/U8eAipEaFY+ZUL8VjQ/uqicubL8JlSB9cir0v9 uh1T9FMse7CiP2ggXqH58keHTiW3CujmvFDGKRbXHNGLqb7Pz/ptgP3UYbJ17ZrGu37J 9FTrVwiip/p3cm+eOHgdAErY+rfYkBN4ycwx8qQyeVBwQBn2gTiY73ML8KDt5KmQHB82 eTsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=L7I4eUqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id iw18-20020a170903045200b001cbe9b9f160si6430472plb.5.2023.11.19.13.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 13:00:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=L7I4eUqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2B5E48059360; Sun, 19 Nov 2023 13:00:46 -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 S231493AbjKSVAd (ORCPT + 99 others); Sun, 19 Nov 2023 16:00:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbjKSVAc (ORCPT ); Sun, 19 Nov 2023 16:00:32 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D30E0 for ; Sun, 19 Nov 2023 13:00:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ewgYBVW+Iax6CqzUrSGGjtpzlAkAA8ZMF03lgMpKaIM=; b=L7I4eUqhsu4ZZE1SCodP+CJCa5 lYRdOOhI8LmR0CCIKa3wU5+7oLM/bhCZcjFmXsE2EfXVh5IrKBhX+la7+E9OeSncmFHwfi6/5jrJF M4ayq94GPqv3jN2o6ub8xvP3YV3p/v1N6H6fhVNDsNQvNcwWG++4ngyUKPQtJft61+hp6P4PcZXD/ M1r/cPpOU+6yynFEkLk5FXGmolrrwfxMKQssZIULatYKHlIy6oIEY0fgrud9V8vigjqGNTAnQmu91 26WPxjLWmrrz99hjnHnjkMe7wAl2aYvKkb/VuGRHZunrgggQMzkBX9EVYZAyeODiVaNNNRBMSxxfL BQasstSw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r4otl-0032p2-JP; Sun, 19 Nov 2023 21:00:09 +0000 Date: Sun, 19 Nov 2023 21:00:09 +0000 From: Matthew Wilcox To: Kairui Song Cc: linux-mm@kvack.org, Andrew Morton , "Huang, Ying" , David Hildenbrand , Hugh Dickins , Johannes Weiner , Michal Hocko , linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/24] mm/swap: move no readahead swapin code to a stand alone helper Message-ID: References: <20231119194740.94101-1-ryncsn@gmail.com> <20231119194740.94101-4-ryncsn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231119194740.94101-4-ryncsn@gmail.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 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]); Sun, 19 Nov 2023 13:00:46 -0800 (PST) On Mon, Nov 20, 2023 at 03:47:19AM +0800, Kairui Song wrote: > + /* skip swapcache and readahead */ > + page = swapin_no_readahead(entry, GFP_HIGHUSER_MOVABLE, > + vmf); > + if (page) > + folio = page_folio(page); I think this should rather be: folio = swapin_no_readahead(entry, GFP_HIGHUSER_MOVABLE, vma); page = &folio->page; and have swapin_no_readahead() work entirely in terms of folios.