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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CDB2C4332F for ; Mon, 17 Oct 2022 00:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbiJQAoG (ORCPT ); Sun, 16 Oct 2022 20:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229984AbiJQAn5 (ORCPT ); Sun, 16 Oct 2022 20:43:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1D4036BD6 for ; Sun, 16 Oct 2022 17:43:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E2A93B80CC3 for ; Mon, 17 Oct 2022 00:43:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A85DC433C1; Mon, 17 Oct 2022 00:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1665967425; bh=etheSZoszu15JPv1eI57PzDXbpuTo9IpNhTmU2vKxW8=; h=Date:To:From:Subject:From; b=ZohXf0yEsN4hymyZIIAxj6zYuLNxCSZ9qj7s3NjF+ilq0x2n63tr1vcbEVWsbUpqe J0VoRVNGwaFGcb+Wn7hRDufW7904h0C/6eV5lqEuUBCtPhYaP4HHDp6bgIssyf7eKX mJVgsa1V45KGlSp086LfhtIt8vZygwoHekJqdilg= Date: Sun, 16 Oct 2022 17:43:44 -0700 To: mm-commits@vger.kernel.org, willy@infradead.org, songmuchun@bytedance.com, minhquangbui99@gmail.com, mike.kravetz@oracle.com, linmiaohe@huawei.com, aneesh.kumar@linux.ibm.com, almasrymina@google.com, sidhartha.kumar@oracle.com, akpm@linux-foundation.org From: Andrew Morton Subject: + mm-hugetlb-convert-isolate_or_dissolve_huge_page-to-folios.patch added to mm-unstable branch Message-Id: <20221017004345.9A85DC433C1@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm/hugetlb: convert isolate_or_dissolve_huge_page to folios has been added to the -mm mm-unstable branch. Its filename is mm-hugetlb-convert-isolate_or_dissolve_huge_page-to-folios.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hugetlb-convert-isolate_or_dissolve_huge_page-to-folios.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Sidhartha Kumar Subject: mm/hugetlb: convert isolate_or_dissolve_huge_page to folios Date: Thu, 13 Oct 2022 20:12:59 -0700 Removes a call to compound_head() by using a folio when operating on the head page of a hugetlb compound page. Link: https://lkml.kernel.org/r/20221014031303.231740-6-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Cc: Aneesh Kumar K.V Cc: Bui Quang Minh Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mina Almasry Cc: Muchun Song Signed-off-by: Andrew Morton --- mm/hugetlb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) --- a/mm/hugetlb.c~mm-hugetlb-convert-isolate_or_dissolve_huge_page-to-folios +++ a/mm/hugetlb.c @@ -2822,7 +2822,7 @@ free_new: int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list) { struct hstate *h; - struct page *head; + struct folio *folio = page_folio(page); int ret = -EBUSY; /* @@ -2831,9 +2831,8 @@ int isolate_or_dissolve_huge_page(struct * Return success when racing as if we dissolved the page ourselves. */ spin_lock_irq(&hugetlb_lock); - if (PageHuge(page)) { - head = compound_head(page); - h = page_hstate(head); + if (folio_test_hugetlb(folio)) { + h = folio_hstate(folio); } else { spin_unlock_irq(&hugetlb_lock); return 0; @@ -2848,10 +2847,10 @@ int isolate_or_dissolve_huge_page(struct if (hstate_is_gigantic(h)) return -ENOMEM; - if (page_count(head) && !isolate_hugetlb(head, list)) + if (folio_ref_count(folio) && !isolate_hugetlb(&folio->page, list)) ret = 0; - else if (!page_count(head)) - ret = alloc_and_dissolve_huge_page(h, head, list); + else if (!folio_ref_count(folio)) + ret = alloc_and_dissolve_huge_page(h, &folio->page, list); return ret; } _ Patches currently in -mm which might be from sidhartha.kumar@oracle.com are mm-hugetlb_cgroup-convert-__set_hugetlb_cgroup-to-folios.patch mm-hugetlb_cgroup-convert-hugetlb_cgroup_from_page-to-folios.patch mm-hugetlb_cgroup-convert-set_hugetlb_cgroup-to-folios.patch mm-hugetlb_cgroup-convert-hugetlb_cgroup_migrate-to-folios.patch mm-hugetlb-convert-isolate_or_dissolve_huge_page-to-folios.patch mm-hugetlb-convert-free_huge_page-to-folios.patch mm-hugetlb_cgroup-convert-hugetlb_cgroup_uncharge_page-to-folios.patch mm-hugeltb_cgroup-convert-hugetlb_cgroup_commit_charge-to-folios.patch mm-hugetlb-convert-move_hugetlb_state-to-folios.patch