Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1588908rdh; Mon, 25 Sep 2023 18:46:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxIv87Gf39yZd6auQNyjjWdqvQDmYa9bY0DQvyqFhF+5kwoqs0xXsJUaVGWKaStj4h2gEU X-Received: by 2002:a05:6a00:1401:b0:691:fd26:f54a with SMTP id l1-20020a056a00140100b00691fd26f54amr10391779pfu.20.1695692808858; Mon, 25 Sep 2023 18:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695692808; cv=none; d=google.com; s=arc-20160816; b=vcTRcPQ0L9AG3sXdysto8qrq4EGZ9+VnjVf865qY5cJav0bVJD+DjWFAwmJDS2sT/e hp3MYFlpnOUyiYVWjQ9NSsH0IWIow6c9/xkEavjNqqg8tcPndFLEyaj+1W1z24aW++dk 4QEIyTLsSZhHJTviZBko9CyEgUjc5XbuA5aWtawzSFvLM2Da5JwrNXgE9ouRQI1NECSZ Jqm5KXaPO2BXwbLGROZdd6RH15jmQIq/+aQEh9yJdNrwiAPxsTdLOq3tPRWuYqkS0Sc2 XSU37oQ0iZQh6t6v389m417kqjm7nvyGPsxvB4AJoSHGXHGxMTEXWQBd82V/e+6LnvKR K5OA== 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=LJk+VfAgLq5Er8DOIN0yMWb5IfchGAilz48qexBmR74=; fh=t5JN1Exz1sNlZpR50Eiyme0eKX/9F9jHctQHxMBaspU=; b=uDjAWpfo1khDwApm6wSlS3BBUwKYvx/dP9jg+MmPjzLz7vBJGqssL3SBUmyREbAU9U YX9ntqKSp61HlUW33ecUGL4yAqaywNVkfNVAfZDi3qEoEbzEubLV4eRz3ba/RbmnxGSP B4uuGuZSglQ2d7jsQ5j5pcoofamfQlSLnWCDcZM4rflayy0DMp8aCZl1YMgxTFYEHsxk BDfjEQg8fig/cnfaEHJEYjcq3SXiKL1G/VRTyKoGNP2Ueb0h88qESKzznynTXf8gWq3C w+E4sytcRWg8/Q3+hLb9RbeqQSlcLHr6vR3+8s2mJD6jOhkq8cU7cKebyLTlY98zw34Z +1VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="K/3YMhch"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id g24-20020a633758000000b00574057d7c19si11841066pgn.220.2023.09.25.18.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 18:46:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="K/3YMhch"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id DED868561658; Fri, 22 Sep 2023 12:46:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbjIVTqx (ORCPT + 99 others); Fri, 22 Sep 2023 15:46:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjIVTqv (ORCPT ); Fri, 22 Sep 2023 15:46:51 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7F00AC for ; Fri, 22 Sep 2023 12:46:45 -0700 (PDT) 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=LJk+VfAgLq5Er8DOIN0yMWb5IfchGAilz48qexBmR74=; b=K/3YMhchXqHO+PC6JetrqrN8ga +1Ip2PdNgTvMh4vRTvOz/jcZF4UkmJ3nqzdu2lBGY5dDDo6beX0B7cOTr0La91OEUWpg5f5IjhGgA +lrgBf4LrnHAS5AeDT0VnyzHmSY6QeT34oX56mTws+3TT2cZpopOLBAmyug89SfytUfiSs66HjfF9 EcOWUidfivMBdWkPKfxMHcK/e8pzV0REuSsOw+O46BKEYbasgkc3/B7xodPeLJ3mDvZdTQdgUUP65 vs4hTgRRHWXEtxj1egkgHVPWGvjoXjTrOe5RfhxNVcA7Guv2qsd/RreW0BTTxHsPbbpb3r76hI0sK 5BldWxEg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qjm6q-002WPC-Vq; Fri, 22 Sep 2023 19:46:41 +0000 Date: Fri, 22 Sep 2023 20:46:40 +0100 From: Matthew Wilcox To: "Vishal Moola (Oracle)" Cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/2] mm/khugepaged: Convert __collapse_huge_page_isolate() to use folios Message-ID: References: <20230922193639.10158-1-vishal.moola@gmail.com> <20230922193639.10158-2-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230922193639.10158-2-vishal.moola@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Fri, 22 Sep 2023 12:46:55 -0700 (PDT) On Fri, Sep 22, 2023 at 12:36:38PM -0700, Vishal Moola (Oracle) wrote: > This is in preparation for the removal of the khugepaged compound_pagelist. > > Replaces 11 calls to compound_head() with 1, and removes 499 bytes of > kernel text. Looks good to me. > @@ -634,32 +633,33 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma, > * Isolate the page to avoid collapsing an hugepage > * currently in use by the VM. > */ > - if (!isolate_lru_page(page)) { > - unlock_page(page); > + if (!folio_isolate_lru(folio)) { > + folio_unlock(folio); > result = SCAN_DEL_PAGE_LRU; > goto out; > } > - mod_node_page_state(page_pgdat(page), > - NR_ISOLATED_ANON + page_is_file_lru(page), > - compound_nr(page)); > - VM_BUG_ON_PAGE(!PageLocked(page), page); > - VM_BUG_ON_PAGE(PageLRU(page), page); > + node_stat_mod_folio(folio, > + NR_ISOLATED_ANON + folio_is_file_lru(folio), > + folio_nr_pages(folio)); > + VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio); > + VM_BUG_ON_FOLIO(folio_test_lru(folio), folio); > > - if (PageCompound(page)) > - list_add_tail(&page->lru, compound_pagelist); > + if (folio_test_large(folio)) > + list_add_tail(&folio->lru, compound_pagelist); > next: > /* > * If collapse was initiated by khugepaged, check that there is > * enough young pte to justify collapsing the page > */ > if (cc->is_khugepaged && > - (pte_young(pteval) || page_is_young(page) || > - PageReferenced(page) || mmu_notifier_test_young(vma->vm_mm, > + (pte_young(pteval) || folio_test_young(folio) || > + folio_test_referenced(folio) || mmu_notifier_test_young(vma->vm_mm, > address))) > referenced++; > > if (pte_write(pteval)) > writable = true; > + Spurious change here. Other than that, Reviewed-by: Matthew Wilcox (Oracle)