Message ID | 20231103140119.2306578-9-wangkefeng.wang@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 6E285C001B5 for <linux-mm@archiver.kernel.org>; Fri, 3 Nov 2023 14:04:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CFBB280024; Fri, 3 Nov 2023 10:04:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 67E98280021; Fri, 3 Nov 2023 10:04:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5469C280024; Fri, 3 Nov 2023 10:04:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3B8EE280021 for <linux-mm@kvack.org>; Fri, 3 Nov 2023 10:04:03 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 05EE6C01A4 for <linux-mm@kvack.org>; Fri, 3 Nov 2023 14:04:03 +0000 (UTC) X-FDA: 81416811966.26.558D67B Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf01.hostedemail.com (Postfix) with ESMTP id 168C540023 for <linux-mm@kvack.org>; Fri, 3 Nov 2023 14:03:57 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699020238; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BksiekM5fz6UlJeefImo+WZsurm9oK7d4R0JBiKe41Q=; b=fKjKl2fvkibvUC8MIqoLtMNm1ZcgaOzgAaR971FpV/GyLfSWWAeO4mHh2NsWpVattIVYqT +HWL3g0Ih0Cp+LjLV204HGMo7ojOUEoo8WTmZJr8qR0SUxc7ZYPQUQko1ydr4hzRiF+OGH IYFc8FKsbNMvTHZVexNCVP9xswQPtLw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699020238; a=rsa-sha256; cv=none; b=heAmpt9SWXQb1Wa9njoaa5WR+1LVZzxREi8A5j7mBM5pzfGpID8YI+ae4UnTbot3YjjXWR BCwkvc6uTQS1iirB54B9JY92o7J4uWJ3zO05KcNC8En59ycn8nRdO6MPOnAawR2Ey5HWXN G170iO9+37Gv3720N7+KQZx2vqkBQ6I= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4SMMpP5g8Gz1P7nl; Fri, 3 Nov 2023 22:00:45 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 3 Nov 2023 22:03:46 +0800 From: Kefeng Wang <wangkefeng.wang@huawei.com> To: Andrew Morton <akpm@linux-foundation.org> CC: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, <linux-s390@vger.kernel.org>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH 08/18] mm: khugepaged: use mm_counter_file_folio() in collapse_pte_mapped_thp() Date: Fri, 3 Nov 2023 22:01:09 +0800 Message-ID: <20231103140119.2306578-9-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231103140119.2306578-1-wangkefeng.wang@huawei.com> References: <20231103140119.2306578-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 168C540023 X-Stat-Signature: rs7qxjx44jomd99zg7qbsouqnf9iushp X-Rspam-User: X-HE-Tag: 1699020237-632172 X-HE-Meta: U2FsdGVkX1/3YL5jpA2gItADQ+qkDDXe2gSmArmWm1703avPQaUcO76VW4+afYdrAIyW0q2mybxua+Mt6h9FO8GDgomBK8M5JbccmhzaT8GHPR276r7VcMTv5l5TC4OweHb/b3PpPhl3Ze23ciJ5YCueTAXJqQgu01jDMCFWCxymhtSdboIZllGqIe/6FxILgB/5Vl+yu2BIsxyZHHDmG5hQI0SdBcQgPEX4CJgBzN9KI1qsnCrRPalUdp49pSEfnWMQnOG1eAFC0ucT5swo7cqoJ3SG2DiERTWf/Auv2KnjO6lfOoGv5BrOCgPd27UmcKdV7N/MHEon+ksUPJubn71Rsncn0vzULgn4GoLobHaLZp4d7SkNWZv7SkYpCe7YNwHUStHk6yLnbt3GKL9ms15fwSG7Id4qLEPxcq7MB7DtHDSlvS/AUIAGlFqh/2iq1B27j0CM9ImQHfKtTWUNLdRIKTByaujE2XkSpQAuXqsprlOkEaB7uLZYFrba4jRZcRZpCs9T2ljSl00a13alKXjWvfQlUFWmV4VjV8DVTPtIzefZEf7PhQ1A9trwXKzUc1445yeUSMQPvs/qd5H0DrRtu6i8sQZrpV14yGKLuwKWMLs02U6kcKDFW8wVeLykagHF+ZqCYWNOGG1DWkne1vlsvb2ALlP5aLgxcp+sj5lkerRVhcORRvxWJUKeiLYIocroDh+u9PpfNVp4KX2zvOCnsqAgoCp9Nxcw8oOByi7ncbaf5oQlzBCyQb7ux+LoHmCx6QeyOfx93WYCVtSGGtv0ixlRgl5ga+0sg2kqa4L2WvH3J97vqd/myXsEimPC4+Bl0Ke5Gqq93xGClOsb/vRHIOKVbaR/DgFIe/t7fGaEdjoKxV9epIzBobL4NRnscNU7CpO9x1oEzEAOwrIVE5/+OLUp5VDVMuAcwGlfZH/66GRzXbs4qzWOJWperuwD59+SEaxhSiv7MLKCsTZ Py5bMlzd K9Z6hBdSdG7cYRiD9TkOXpGqDZbRdk4+MHVCXG/i7O7dtpIf5tRwq9jQdp+7Iyf5q/Rn/XkJ7qWeRHZwJzTUZBz4lfdGObwh1M7sUP5H34ltk4zGqJsKiTab3Gw1ciAxuUQ24Db3G0nd5D3p34hiTidaAUfO2miaAxT6ChD0Cg+A/H3AethANzLuF9Zmxa98hrtFp 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: convert to use folio mm counter
|
expand
|
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 064654717843..a6805f4f6dea 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1630,7 +1630,7 @@ int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr, /* step 3: set proper refcount and mm_counters. */ if (nr_ptes) { folio_ref_sub(folio, nr_ptes); - add_mm_counter(mm, mm_counter_file(&folio->page), -nr_ptes); + add_mm_counter(mm, mm_counter_file_folio(folio), -nr_ptes); } /* step 4: remove empty page table */ @@ -1661,7 +1661,7 @@ int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr, if (nr_ptes) { flush_tlb_mm(mm); folio_ref_sub(folio, nr_ptes); - add_mm_counter(mm, mm_counter_file(&folio->page), -nr_ptes); + add_mm_counter(mm, mm_counter_file_folio(folio), -nr_ptes); } if (start_pte) pte_unmap_unlock(start_pte, ptl);
Use mm_counter_file_folio() to save two compound_head() calls in mm_counter_file_folio(). Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- mm/khugepaged.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)