From patchwork Thu Aug 24 14:13:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13364245 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6B4FC27C40 for ; Thu, 24 Aug 2023 14:13:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1AEF8E0015; Thu, 24 Aug 2023 10:13:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C4D52800AB; Thu, 24 Aug 2023 10:13:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88C058E0016; Thu, 24 Aug 2023 10:13:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7BB098E0015 for ; Thu, 24 Aug 2023 10:13:39 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 08729C0388 for ; Thu, 24 Aug 2023 14:13:39 +0000 (UTC) X-FDA: 81159191358.01.44ACE15 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf19.hostedemail.com (Postfix) with ESMTP id 86B531A0019 for ; Thu, 24 Aug 2023 14:13:36 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=rDd+vA1J; dmarc=none; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692886417; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EIzc7siWEfndHvEXduqOk/KRK5+pIbbkvQpbSnQ2XKY=; b=YmI8lTZZy1eocarADtCPtGjYFQFFG5v4VbD2RhrU2COVnEx1J6gwBWu/TOWhx1T2JN4j77 LjGN4KEdKIG1pLWRA42oqGMUbx2ox17qppEAIqpmIkOa4o2+qXG2tGtiVa6MV2dxIYdXZO rXbpTZtfK9BWpOrQEhakXtf7xwfLIsQ= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=rDd+vA1J; dmarc=none; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692886417; a=rsa-sha256; cv=none; b=OqnTVFE5e0xKDMQniY50eNdYacM2tk+UxQf6BWYKW3sZGnM2n2qPFE2Slz15ZKWY8tW/rH uIn93kfXEaBGQ/PVl65Jq4D72AYKSQCjbdeBSJvQ3rofScfc9RsPVHcMAgpcNjxE7f8d/W brL5cVc7tLxi7/Ts44FgqE3ixhUNdmY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=EIzc7siWEfndHvEXduqOk/KRK5+pIbbkvQpbSnQ2XKY=; b=rDd+vA1J7mXhUhpKS7xBQhLnxO 6zjMkUulkoXXcEtgq8B5LYSzw1bGxbHf0Mo0f9YXXoab8qbrk/vR1VowfZAY2EmayGMXPC3PFI3vG INdLgYWPezVoomV63Vo3Xfi4nLPATvawBCRV1xkyd4weM2B4U3J06Z+UyzfWgSm42Y/KSZH2CxAnF l/oE99agDz0rr5oH8++mo9HGxB5lEj1cwk2KiyVT89P8qZS8rq5L5MRf5jv111GVhmGUbIxlvPBPK PoOtthumOBhI2Fc7FOEZNI4GZs9ERjHgzIHxpNkbEn9RoL4MQAEpOU0VRWDM/k56dFjffYqfpd3CC 6K0fGrrg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qZB5U-00BLaa-KL; Thu, 24 Aug 2023 14:13:28 +0000 From: "Matthew Wilcox (Oracle)" To: Mike Kravetz Cc: "Matthew Wilcox (Oracle)" , Muchun Song , linux-mm@kvack.org, Muchun Song , Sidhartha Kumar Subject: [PATCH v2 1/3] hugetlb: Use a folio in free_hpage_workfn() Date: Thu, 24 Aug 2023 15:13:23 +0100 Message-Id: <20230824141325.2704553-2-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230824141325.2704553-1-willy@infradead.org> References: <20230824141325.2704553-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: wmg8pehwtzt9c9xajgnd4d1tajhcrqyx X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 86B531A0019 X-HE-Tag: 1692886416-64773 X-HE-Meta: U2FsdGVkX1/ZRCyqgpjHvkYLS2EmOr3fC2B6aezvcBjKrYn3isSwXLBhZyeVhaCx5LSfyQeYmGz+LXwKIzhW+ep9KPjehhL/5mpLc7WbyoSvWC/Xt6BZ+JMzMNfZp7sztieN3COkLBXBpXAVTR8kUXTa2O/lacMGqU7Z8pwCxd2COT0DlB7fIju0g1Hx8z7QMg5NE5mhhzddPbIqONy30QYCvTBDelWmRyPuj+osYap+hXLil46zqH1bNSsA2Sp6z1rqasJ3tRBbrzl+1YujfvyyeS+k5Le+sd0gvQByrpJKXuUGi9xHnAUKXdCYjf60cewC99bV2Dc7Dkrmwx8B6hL6TYupGS/7oRIjFVqli2E6Gs4OVjAZcBefIOeCd8sQJ4G90R1dBWiAr66Ee3L/n9LPZtYwM/XwuhPtvLmS8MOjUga7mHP798f4wAiuicu9LYTwWziZMcF2wEC4vDzp/RFtUIG1LwFCGV5/By7qDQe2i578zFvoLIErF7arGOaCjoCf3EQeCrW0Zpjv8vGAM2+tuvd0qPvAjdW0Ei2MyL2p4nZUsUOCg8TbBnx98s3CP/jU62HsJzkJqjcYH4nFnuqRviPQ+2SJ242NXkgDulFAYzSbBmhJjb100z56ay5OnPSd6HBUgn79SX38Jdb5qSwruJ4qeERhweL6tQCb7I1MxKqp2tiMW5k1Royk6QzGoAEXYCj8iFlpTHVXA6hDzQEsR0GMycWCirRFkAEi3f6iPNrclN7IeYJvRiMFkfuXk13/Fs0Eh4qzOIaMhvQ3C7ZkIjCMz584zL82IQ02dNvJpZEh2RRl8AxwkxUplsb8ILVJGvC5R2ZsoZaoGKej7eUquiISlDEBhvo+pNdI2OYZVHYgakjG5jgSCvFDAmwnKdy5wQ7UszdkI5FemJmTKFnSaXO48ZIS9Cf3En0q7PJ43XGCW9+7npag3BXDOAMmZqqqAZyJ87l17C9LHcn CLOwzbtV 0i4FLZpMzmzchMvaSo1rOfrhXVX1q/tWR2Pl2o7jNW6ROLrZF11J6gTFQrcdaiIDg3ltuUK5hHC/JUk3UNzXV+8OmapBn6TzAP+uHkYp2wW/6cilsuHtFtcjeS+ldFgKFSEcEN0q3VGV34kOJ7ThQgE/1fbeUx1SNCZU9bXPyB6M2znVEPZYiu35JNAtfsoQN7xULS1QAS5fTxcJgyFGI4yvBT3XRyAdmZHwnFRTuLc8+rbTGxvSAlNCIc7LobNAMnqbLPJLhfyh3bqu/X+Pnbl+2lpNwsdw4mNz6pgZpFSfqGKa2EI/43z/3Lw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: update_and_free_hugetlb_folio puts the memory on hpage_freelist as a folio so we can take it off the list as a folio. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Sidhartha Kumar --- mm/hugetlb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index a82c3104337e..d1c856628bac 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1786,22 +1786,22 @@ static void free_hpage_workfn(struct work_struct *work) node = llist_del_all(&hpage_freelist); while (node) { - struct page *page; + struct folio *folio; struct hstate *h; - page = container_of((struct address_space **)node, - struct page, mapping); + folio = container_of((struct address_space **)node, + struct folio, mapping); node = node->next; - page->mapping = NULL; + folio->mapping = NULL; /* * The VM_BUG_ON_FOLIO(!folio_test_hugetlb(folio), folio) in * folio_hstate() is going to trigger because a previous call to * remove_hugetlb_folio() will clear the hugetlb bit, so do * not use folio_hstate() directly. */ - h = size_to_hstate(page_size(page)); + h = size_to_hstate(folio_size(folio)); - __update_and_free_hugetlb_folio(h, page_folio(page)); + __update_and_free_hugetlb_folio(h, folio); cond_resched(); }