From patchwork Sun Apr 2 10:42:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 13197368 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 903F0C76196 for ; Sun, 2 Apr 2023 10:43:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BA666B007E; Sun, 2 Apr 2023 06:43:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26B496B0080; Sun, 2 Apr 2023 06:43:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BEC86B0081; Sun, 2 Apr 2023 06:43:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EF7456B007E for ; Sun, 2 Apr 2023 06:43:30 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9C6E680794 for ; Sun, 2 Apr 2023 10:43:30 +0000 (UTC) X-FDA: 80636114580.07.8B9518B Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf26.hostedemail.com (Postfix) with ESMTP id 6B609140008 for ; Sun, 2 Apr 2023 10:43:28 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=EQvCyUUe; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf26.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680432208; 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=8i423JRtxVSXXcfEQgFW9GG7VnT0fmrCfVeKml7P7gc=; b=gYxqriuhmyNM1ujL7uo/++3m3WeXIjLkfWTSOSYOcDwQy83ruWVqPINe++mxaheeyU1uhP IY3c28/cXr3WUG/T9Muez6d3wBvAS7EARquyjNHlRFlG3Mo/X7Gxlvob3+w3mJBiy6Uq37 sTk3HzVBsj10GObhy8oBMLw3jFqObVA= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=EQvCyUUe; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf26.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680432208; a=rsa-sha256; cv=none; b=F/xnqm776GCXlexPjA5Dx87h8StjR/+7+8Y0nuPu98Fe35DYf/FwJS8yaEalkU1gaoI+PD mkzDJp2JlkCiucnn2l8Kb9E/PeX2dd8rAJsnmARN7vx6b7pL0kqZ78s2E7mo0uQqDbh+Wt hp9cO+KKJRRnzzsVRf8P+IpltM5n52k= Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3326uPYx024561; Sun, 2 Apr 2023 10:43:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=8i423JRtxVSXXcfEQgFW9GG7VnT0fmrCfVeKml7P7gc=; b=EQvCyUUeFIt/tB55pmdHIUsrfadx1zRLrUXWr4yb8+DeBbO8PdOgEWfeoX8CNTSdRups Ahx0kTWdqFa398iyTOqf8ZM2CFAwUQv7VIX/CnSEmGN3wmtYKSJPqFaXHV47eS/WlGCL HtqNmOg91OMe7iEaijDLcqDiO99aT8tTkLi5atToIu3rMkKuyK9vj4Nb9e8ZUg3iDGoz O/Lqh6ozn1+gf35cgSK3uWBr9c4knztUB56/pNQBHkKckNo45n0MtTiKkz5arTeJiP7E xv1e7ChdfpwjVKYDv4D+szqjfMZzLiBNusuloBjHwaE3hmHNhv2adMRbCxC4kTEvVFQ1 uQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3ppxj0q5pw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 02 Apr 2023 10:43:25 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 332AeOW4013285; Sun, 2 Apr 2023 10:43:24 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3ppxj0q5pr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 02 Apr 2023 10:43:24 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3326iF51024232; Sun, 2 Apr 2023 10:43:23 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([9.208.129.113]) by ppma02wdc.us.ibm.com (PPS) with ESMTPS id 3ppc87x1uv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 02 Apr 2023 10:43:23 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 332AhMaR15729368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 2 Apr 2023 10:43:22 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EAF15805A; Sun, 2 Apr 2023 10:43:22 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D396258056; Sun, 2 Apr 2023 10:43:18 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.8.200]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Sun, 2 Apr 2023 10:43:18 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: Dave Hansen , Johannes Weiner , Matthew Wilcox , Mel Gorman , Yu Zhao , Wei Xu , Guru Anbalagane , "Aneesh Kumar K.V" Subject: [RFC PATCH v1 6/7] powerpc/mm: Clear page access count on allocation Date: Sun, 2 Apr 2023 16:12:39 +0530 Message-Id: <20230402104240.1734931-7-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230402104240.1734931-1-aneesh.kumar@linux.ibm.com> References: <20230402104240.1734931-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: dfQIoHO6P2ZTBwTUjveI9zFBTEEDvOFq X-Proofpoint-GUID: LwqAtgGrqRLM0WmSlfo_ns961-s7Tj62 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-31_07,2023-03-31_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304020092 X-Rspamd-Queue-Id: 6B609140008 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: rdh5n4jc1duu6jbk931ge3un5x97bzuy X-HE-Tag: 1680432208-971725 X-HE-Meta: U2FsdGVkX18jF11m7PKwhgl0IHyeNRLcLUmqJ6d9A2EmsNRKkvvyiinkovcb5B3sEB9KpDzXpBFLD7UjX0uvxXBzAf8OrtDeegaHk5+zcS+fHOubox642dQeokrzbymNt68fpiEQcOpPoxG0wtflOzf2mkEYUyASJvyCPl7ueSIH+JhbUDZhORV+SpbHkEARGC/R5lY+YvI7MJpLAbAuTsHCqLoDKyZtXZm6ITWVgW1H1Bd7mJILUL0Y7FWe25RCgKJm7Uowr5eDBmNhKbdRAqkDjfDJ4AWkj0xB4W1hOUlTPWlqpD03NHfdwSMTzriGW71YSUxdoom32CG041cNKuXSPN+P4P0ZzIZ88ErAhesUhfbAWXW5BRsYEPkLhQsu3DoI/llxs+ZTAR1Kw2R57xz8mCluLXrKh814z6loKEoau84vRVbrt0k3nIOJg+O6xj7cszHbh8utIN8t+yjs4weXOL/liD0M73ZAX6+3M6gdiHuXklIx65XxTpVwmXZEJAx3StKuW6eSspAbahjX96j0UgQmhHcbjZhLaubVDLpBxYPgXNrpRZCVdHXAaVPMtFmRIZSMVbamuraCixnM2tIHUUuu4/0R3TbCeDuuDf1yrrGjWygOmuqQtN45DoaQgK1akKbgqip8SFm1JzHBx1fQWEd5UZDR6/0rnf/QzyDQB9Drt/1lfSD+8tWYJ/wVCH1kf7Ss8MAw+CE4Lt9tPEO1XA2p6wksFRZug0mbQ2BlcgboJqBdf102jKxDF9hGtZF7uRWuH/YXtcsIAlNs/e+xBKTKCbz4FOKR3TRCpR1FXudU40l2O1tI1/QBl4Hz8p0b3RasZJYtjCrMraH0/q4AWAyifruu98MpMgXtbKHTmgDXv43TM3i/09sMyyrqPbfJCUTvQ1CMoYaLueZxxP/f8+j4CQg3K9px8+KK74XccGI6DuoEFWRRe4eRxl/a5viSRIQRZTYQnaIe7Uz 8wFOuMV0 2VXwPN0b1gIOnU5+fVhd7bjyqpdnxaxULVAVNF2i6qVsf+BJfGT0KScl7Mq4oo9ra3QcfIUPbsijML32ABmYKe4SboWqRZ0QHzVHN1JoGQ5YKd2SS9zPlnbAgxBeDtvl4hk1aq7UamFKUMCFtWZuEFLZ1OWkNgCnQ3LKp 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: Clear the HCA access count value on allocation. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/page.h | 5 +++++ arch/powerpc/mm/hca.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index edf1dd1b0ca9..515423744193 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -319,6 +319,11 @@ void arch_free_page(struct page *page, int order); #define HAVE_ARCH_FREE_PAGE #endif +#ifdef CONFIG_PPC_HCA_HOTNESS +void arch_alloc_page(struct page *page, int order); +#define HAVE_ARCH_ALLOC_PAGE +#endif + struct vm_area_struct; extern unsigned long kernstart_virt_addr; diff --git a/arch/powerpc/mm/hca.c b/arch/powerpc/mm/hca.c index af6de4492ead..1e79ea89df1b 100644 --- a/arch/powerpc/mm/hca.c +++ b/arch/powerpc/mm/hca.c @@ -261,6 +261,19 @@ static void hca_debugfs_init(void) hca_backend_debugfs_init(hca_debugfs_root); } +void arch_alloc_page(struct page *page, int order) +{ + int i; + + if (!hca_clear_entry) + return; + + /* zero the counter value when we allocate the page */ + for (i = 0; i < (1 << order); i++) + hca_clear_entry(page_to_pfn(page + i)); +} +EXPORT_SYMBOL(arch_alloc_page); + static int __init hca_init(void) { if (!hca_backend_debugfs_init) {