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 EA767C4332F for ; Tue, 1 Nov 2022 22:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbiKAWlU (ORCPT ); Tue, 1 Nov 2022 18:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbiKAWlC (ORCPT ); Tue, 1 Nov 2022 18:41:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACA28DEC1 for ; Tue, 1 Nov 2022 15:41:01 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 481D36170B for ; Tue, 1 Nov 2022 22:41:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4666C433D6; Tue, 1 Nov 2022 22:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1667342460; bh=kpu7lj63a0AUWfw0HfKPINZTjgB6GfnBl/N1aai1bzY=; h=Date:To:From:Subject:From; b=HUbMSRARWSgfWO74MgYE/HjWV8E+JgeKYJ4g8ApVku+GAGxJcq30iTB7637ZdGNFD cFAifo8M6ElhmE7RcnVRUm0b/R0SgOcK7Z8EWvQa8Dimwdoy3X8zuKvbI4C1SpO4bj EvqmXs1E00UHKRFb03c7DH2rcyFJL9P5ENSWm7qA= Date: Tue, 01 Nov 2022 15:41:00 -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-hugeltb_cgroup-convert-hugetlb_cgroup_commit_charge-to-folios.patch added to mm-unstable branch Message-Id: <20221101224100.A4666C433D6@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/hugeltb_cgroup: convert hugetlb_cgroup_commit_charge*() to folios has been added to the -mm mm-unstable branch. Its filename is mm-hugeltb_cgroup-convert-hugetlb_cgroup_commit_charge-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-hugeltb_cgroup-convert-hugetlb_cgroup_commit_charge-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/hugeltb_cgroup: convert hugetlb_cgroup_commit_charge*() to folios Date: Tue, 1 Nov 2022 15:30:58 -0700 Convert hugetlb_cgroup_commit_charge*() to internally use folios to clean up the code after __set_hugetlb_cgroup() was changed to take a folio. Link: https://lkml.kernel.org/r/20221101223059.460937-9-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz Cc: Aneesh Kumar K.V Cc: Bui Quang Minh Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Mina Almasry Cc: Muchun Song Signed-off-by: Andrew Morton --- mm/hugetlb_cgroup.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/mm/hugetlb_cgroup.c~mm-hugeltb_cgroup-convert-hugetlb_cgroup_commit_charge-to-folios +++ a/mm/hugetlb_cgroup.c @@ -310,21 +310,21 @@ int hugetlb_cgroup_charge_cgroup_rsvd(in /* Should be called with hugetlb_lock held */ static void __hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page, bool rsvd) + struct folio *folio, bool rsvd) { if (hugetlb_cgroup_disabled() || !h_cg) return; - __set_hugetlb_cgroup(page_folio(page), h_cg, rsvd); + __set_hugetlb_cgroup(folio, h_cg, rsvd); if (!rsvd) { unsigned long usage = - h_cg->nodeinfo[page_to_nid(page)]->usage[idx]; + h_cg->nodeinfo[folio_nid(folio)]->usage[idx]; /* * This write is not atomic due to fetching usage and writing * to it, but that's fine because we call this with * hugetlb_lock held anyway. */ - WRITE_ONCE(h_cg->nodeinfo[page_to_nid(page)]->usage[idx], + WRITE_ONCE(h_cg->nodeinfo[folio_nid(folio)]->usage[idx], usage + nr_pages); } } @@ -333,14 +333,18 @@ void hugetlb_cgroup_commit_charge(int id struct hugetlb_cgroup *h_cg, struct page *page) { - __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, page, false); + struct folio *folio = page_folio(page); + + __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, folio, false); } void hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, struct page *page) { - __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, page, true); + struct folio *folio = page_folio(page); + + __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, folio, true); } /* _ Patches currently in -mm which might be from sidhartha.kumar@oracle.com are mm-hugetlb-add-folio-support-to-hugetlb-specific-flag-macros.patch mm-add-private-field-of-first-tail-to-struct-page-and-struct-folio.patch mm-hugetlb-add-hugetlb_folio_subpool-helpers.patch hugetlbfs-convert-hugetlb_delete_from_page_cache-to-use-folios.patch mm-hugetlb-add-folio_hstate.patch 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