From patchwork Tue Jul 18 02:29:28 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: 13316678 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 B9DEAC0015E for ; Tue, 18 Jul 2023 02:30:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5554F6B0075; Mon, 17 Jul 2023 22:30:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DDCE8D0006; Mon, 17 Jul 2023 22:30:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37E678D0005; Mon, 17 Jul 2023 22:30:44 -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 287856B0075 for ; Mon, 17 Jul 2023 22:30:44 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 02C901C8D48 for ; Tue, 18 Jul 2023 02:30:43 +0000 (UTC) X-FDA: 81023154408.07.F56C6D5 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf06.hostedemail.com (Postfix) with ESMTP id B8AF1180005 for ; Tue, 18 Jul 2023 02:30:41 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=jeqfpFQZ; spf=pass (imf06.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689647441; 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=VNEBeAWzU/CT4iyd6EAoxgzBL6LW64vgyDe8qKmFgh0=; b=u9FuJvNRpq6yKiVVGDIlJg6zqzo+05UBGt2Uy46Y9DX2yeDW7+ApPSx6zn/ey44zrTL61m WBdLGBg0oX5ikINJlEyUuX/YXa18o8cAIgHjqWV4igUtph7DKr3cRdTI7kEhOwMS9fuKFI +2hWwv9f2BlYeJk3Cc+YVOIHCm2NNFw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689647441; a=rsa-sha256; cv=none; b=Zoc/J6qZhIJwkLQ+u7uHZf5suAAQ4o2jjYs0uYxOG7jFWiZMICfdEcIWvowlPlAoQpoF7r UVFzHKIzijVQyXuZGqTVd2WA4t4LabOw/gHtBWezLJWuHDwf3VpNxYkgdqDr/py/1zzJxS RrL0rghF2Zwv6/cKwg8JBURi4RK0bzQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=jeqfpFQZ; spf=pass (imf06.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36I2ESnc015898; Tue, 18 Jul 2023 02:30:31 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=VNEBeAWzU/CT4iyd6EAoxgzBL6LW64vgyDe8qKmFgh0=; b=jeqfpFQZjGupCiZ6A8A0m94xnpnZ8ouEjqUeHYMXgegKr/zn+vjPNuQiQPxfV7FlN8+f u0nKRNMjuJWs8nmugxNRnfU9atd64js+atW3hVe3IQiIQJYfm13Mc+4rmgvjw/o1AZh8 HGeJT3+cHiQIXszB4hFX/Q46bUSzhL5vST6QnoxC+3DEDl2bL6D8iQ7d4/+KPP84nsnu Ggzj1ta1+fVhpez7NulGNLKY5oSjASEv7pqaW/h7d1IG5EyJYemHWb7zOJbQtISxOXKS ZYiMZhONPElojvU9Hq3xytr0s7asWw2cXpU9dM9PUMpTRi2ZhZFWLuXrFpESBEUyCD6W Gw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rwhs809u1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 02:30:31 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36I2FGP2018637; Tue, 18 Jul 2023 02:30:30 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rwhs809tt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 02:30:30 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36HMmEo7029129; Tue, 18 Jul 2023 02:30:29 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3rv6smbtau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 02:30:29 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36I2UTeK6488632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jul 2023 02:30:29 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F5C958057; Tue, 18 Jul 2023 02:30:29 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3369258063; Tue, 18 Jul 2023 02:30:24 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.62.199]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 18 Jul 2023 02:30:23 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: Oscar Salvador , Mike Kravetz , Dan Williams , Joao Martins , Catalin Marinas , Muchun Song , Will Deacon , "Aneesh Kumar K.V" Subject: [PATCH v5 08/13] powerpc/mm/trace: Convert trace event to trace event class Date: Tue, 18 Jul 2023 07:59:28 +0530 Message-ID: <20230718022934.90447-9-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230718022934.90447-1-aneesh.kumar@linux.ibm.com> References: <20230718022934.90447-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: f4UAcqeplPmsunleHh4YnXcYkxb1EaV4 X-Proofpoint-GUID: IZtQYHfavdkrOdtBOck1b5xyVf-SazP0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-17_15,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 priorityscore=1501 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307180017 X-Rspamd-Queue-Id: B8AF1180005 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: t9tq7sob7q8b4otdyaoki8ci3hgkabxn X-HE-Tag: 1689647441-39588 X-HE-Meta: U2FsdGVkX19vIAG2WlwfsYXmGf4jNaHgTEV6z2zF8q1sCo7CWNkCSwLPTnYPj/iNAECgtZ84HC/z18JRq3/ZaaUT6oePqfFf+BVuL82fNeQcHtMwylBNvU+tFsRcrCIV60ToY36FPNq0wGIIB4gctRCngSuRSN0zAU6kqG5muO/rrJo7oH7oe5xeBp96KzARnEH03GvUApqXdYUWlZggT76ZWGlFBuhD68doXmrxnLYNCD2jzKYtFn5jFcKrESne+F0SvZBwxlqJEXN+RhKeEJWEbOVL0lx8zFq8PNZfKC0ylY30rUJfO/xk9ec9KsI7v/I+RCSTbnE8LfLzaJJSCacpzA5UpLAIvTjqiKHaZ3ujcxysAtd2QPAQNXmAz08KlOS58RkdtAmSR4nC9ZnZfpojXO470wB+Y8F9VNIUX4V22GNHUQyyHRSaGUojZOPKxlLvX1oeL4MUz+TAQmzZqRWYCIoXNjgv9F++kCAlUEGCPVu8VKSuLZ7UGcTLnrrRRli1nXzPVino/XlLy9CIw00JSAb1czbSQ3uTbY871f8POH+CP+OwXeQbv/dA9+EFhTW7S+WAEfaFALk7uBrOPF76KDQYRLm2IUdyda4tQJt3FlnhOrStmTcU//wPryea34B9a7FQDFQTZtrmJ/gYoTMSb6M3cPsU1/ge/dVZOhTgszUdZ9Ct92WDXFDX/e9EsRJEhSVbkIjXtBlTiaDs6vUtw2XSL9bHKFm8EOlzZRNMGhnjc/GtDIcfZE6NVuGisHdbRO+79pthLsunWCGrwva/mm6KUw5VguCjFJJfk1k4VHnd5+QoovABFMLIWz9CfiflKa8iljEy4A6fBMY22Tf4y9PXQaSNQ/2kQswLeloGeu7NeAvzNshkxtKpKw1dnrDQVXF6H/6Teh7URweDKCN72HzT9N7n0oveRNhe44UgSjx3qRpSbSQ/YX80U1U8UP/aOBmwcot2LztyFIf VVeYhIp+ yW6dCfz/DxZ3pB8nPNdhzpiWBukhbuo8gU5IixCA6UYZPerea3XdSTVBva5/9qQUiqkPPGtxlJqDh1Q3vSwjHt5x/D9mP1nj9KW1tKE1n2ovWYNtpBgmNuhr32otZAKpCUtTguu0K3uclmF6NBVAMIkKv+iR1eUdoV0vT7OimVqqbmZjTrEjzFE+7HjUoVzblaJNTDrJoahr/xho= 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: A follow-up patch will add a pud variant for this same event. Using event class makes that addition simpler. No functional change in this patch. Reviewed-by: Christophe Leroy Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/hash_pgtable.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +- include/trace/events/thp.h | 23 ++++++++++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/mm/book3s64/hash_pgtable.c b/arch/powerpc/mm/book3s64/hash_pgtable.c index 51f48984abca..988948d69bc1 100644 --- a/arch/powerpc/mm/book3s64/hash_pgtable.c +++ b/arch/powerpc/mm/book3s64/hash_pgtable.c @@ -214,7 +214,7 @@ unsigned long hash__pmd_hugepage_update(struct mm_struct *mm, unsigned long addr old = be64_to_cpu(old_be); - trace_hugepage_update(addr, old, clr, set); + trace_hugepage_update_pmd(addr, old, clr, set); if (old & H_PAGE_HASHPTE) hpte_do_hugepage_flush(mm, addr, pmdp, old); return old; diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index e7ea492ac510..02e185d2e4d6 100644 --- a/arch/powerpc/mm/book3s64/radix_pgtable.c +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c @@ -962,7 +962,7 @@ unsigned long radix__pmd_hugepage_update(struct mm_struct *mm, unsigned long add #endif old = radix__pte_update(mm, addr, pmdp_ptep(pmdp), clr, set, 1); - trace_hugepage_update(addr, old, clr, set); + trace_hugepage_update_pmd(addr, old, clr, set); return old; } diff --git a/include/trace/events/thp.h b/include/trace/events/thp.h index 202b3e3e67ff..a95c78b10561 100644 --- a/include/trace/events/thp.h +++ b/include/trace/events/thp.h @@ -8,25 +8,29 @@ #include #include -TRACE_EVENT(hugepage_set_pmd, +DECLARE_EVENT_CLASS(hugepage_set, - TP_PROTO(unsigned long addr, unsigned long pmd), - TP_ARGS(addr, pmd), + TP_PROTO(unsigned long addr, unsigned long pte), + TP_ARGS(addr, pte), TP_STRUCT__entry( __field(unsigned long, addr) - __field(unsigned long, pmd) + __field(unsigned long, pte) ), TP_fast_assign( __entry->addr = addr; - __entry->pmd = pmd; + __entry->pte = pte; ), - TP_printk("Set pmd with 0x%lx with 0x%lx", __entry->addr, __entry->pmd) + TP_printk("Set page table entry with 0x%lx with 0x%lx", __entry->addr, __entry->pte) ); +DEFINE_EVENT(hugepage_set, hugepage_set_pmd, + TP_PROTO(unsigned long addr, unsigned long pmd), + TP_ARGS(addr, pmd) +); -TRACE_EVENT(hugepage_update, +DECLARE_EVENT_CLASS(hugepage_update, TP_PROTO(unsigned long addr, unsigned long pte, unsigned long clr, unsigned long set), TP_ARGS(addr, pte, clr, set), @@ -48,6 +52,11 @@ TRACE_EVENT(hugepage_update, TP_printk("hugepage update at addr 0x%lx and pte = 0x%lx clr = 0x%lx, set = 0x%lx", __entry->addr, __entry->pte, __entry->clr, __entry->set) ); +DEFINE_EVENT(hugepage_update, hugepage_update_pmd, + TP_PROTO(unsigned long addr, unsigned long pmd, unsigned long clr, unsigned long set), + TP_ARGS(addr, pmd, clr, set) +); + DECLARE_EVENT_CLASS(migration_pmd, TP_PROTO(unsigned long addr, unsigned long pmd),