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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1446C3065C for ; Tue, 2 Jul 2024 14:21:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 293A66B0099; Tue, 2 Jul 2024 10:21:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 244AE6B009D; Tue, 2 Jul 2024 10:21:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10AA56B009F; Tue, 2 Jul 2024 10:21:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E6FD66B0099 for ; Tue, 2 Jul 2024 10:21:08 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8DEBAA1C47 for ; Tue, 2 Jul 2024 14:21:08 +0000 (UTC) X-FDA: 82295024616.26.5B58A36 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf07.hostedemail.com (Postfix) with ESMTP id 703F140020 for ; Tue, 2 Jul 2024 14:21:05 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719930036; 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=K8dOU+8ktTSue5CE9LfPuc8sv8KM9MOy19wr8SaJZh0=; b=2ygsEXINzD5GqMMjEtiqKQVLyKMKV49SWIJHSheQxefXXkLzva8UINBDn96UXQwxh1sSOA w7vE1o33tH5Tnw6lZw5f+PzfItrIp+S4Krtk+LGHwauMnqbVcagiYiL5wO5yQa2Htz9IOz TowDybY04NTVWPki6e7n2yJuDfiXFeQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719930036; a=rsa-sha256; cv=none; b=Z/JDE1d65mDCEf4e6Fok8GQacNByR6wlut3cZGoTMW+a9egDO3EClyoPEajv0iLLTU4X+5 SVkeD44BFxc0B/NKG1NdU6tuioKBvybVMxaQWx3K2KZ21P2MkGPMFvjF3H3TvCwOgQ3woq 4wm1CyRNSIxia85nyd367RhLznAts7U= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WD4hr5GkHz1T4Fw; Tue, 2 Jul 2024 22:16:28 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id E9C0A1400CD; Tue, 2 Jul 2024 22:21:00 +0800 (CST) Received: from [10.67.111.104] (10.67.111.104) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 2 Jul 2024 22:21:00 +0800 Message-ID: <5856cee4-1e13-4c67-8fea-f5f938f7452f@huawei.com> Date: Tue, 2 Jul 2024 22:21:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] hugetlbfs: use tracepoints in hugetlbfs functions. To: Mathieu Desnoyers , Steven Rostedt CC: , , , , References: <20240612011156.2891254-1-lihongbo22@huawei.com> <20240612011156.2891254-3-lihongbo22@huawei.com> <20240701194906.3a9b6765@gandalf.local.home> <1eca1fcd-5479-47b2-b7ba-eb4027135af2@huawei.com> <8015a0bf-39e2-406c-8f61-db87a40a71a3@efficios.com> Content-Language: en-US From: Hongbo Li In-Reply-To: <8015a0bf-39e2-406c-8f61-db87a40a71a3@efficios.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.111.104] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500022.china.huawei.com (7.185.36.66) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 703F140020 X-Stat-Signature: 67mnhwu4i1xzhhougx5y6sbhwb3n1mj7 X-Rspam-User: X-HE-Tag: 1719930065-60188 X-HE-Meta: U2FsdGVkX199eFroRzw8HbSd3dmEyeMDjvnqo05O7D6zdzTbT3njx2dkl033R5oPilOSe36pxZeGIrMCsH19fDxB3aZqTMtALqonpwIuq0w5cF7J/tipLaPW2GuvK3vvcHFnzJH7DXY/wH/nwcmoGJMAwMyqLlgz+X6oZbEn06YvmfA8RFhgwBGZAPMBjBKGN40eJZfcenLMC7xfSFarY/11aV9P8no0qjJIQjQ6qL+eA+VKEu6gnaqXw5SkZUYOQm1f37IJMIH0KF2qw4SHAyaThApuW2RXgkycc/dylI4B7c0T6G5hYnQgT5RKKpVgb+R2Chr8BEaf6UhPuEbSeQmBJIpMEyYXLH4emioCl0XxWTN4kv4bquTwEQx01DUJHlM9hLT/ys2gSNWLCumld6eOPwxM42BN9ZIEyjcAo5FlW06ewcZEYd5DJoJmZl2Pv+39wcgkcCXwv2OJnUyHKc3R6GLoquiRIDPwzz19WeEjy17dptxm1Ke6X73I+sFv8RPCNBkgvktcorZkucB3z5NGLdXLe20j0f3CuucLn7LhvbnzxyODq41rzslzjcKqt6sCFYSn76kqy2e0yUORy5Me8qBYNEOdEEFOAMfXKbt607dfqma8tpNRhjWqpC7lebG4EM72BIbD6m8pQczzrhJ32li3jKvjDy0nrOaISWDMn3mGRkhJLYOUqwQFXtwoVE8DFv2rduy/0OLXFZie6wk7eUKbXWNVNVRq6ymqlTG0VmdLTGiKjvrtx79LI8wJn1gVOju3gWLQ40maaoM0xRANqpt13zxKxgLVo9jR/Oey4g6jty4TAKLURiN8roivarZtN+8YQ4t3YXVe50+8Hn4F3ZIJn1UMuud7vsygvQTA1oE5tcXAs7AcQspx8qyBhnK0ot4TVN8gNzZ8DsCr/eyqltLvEuMvX8QB15Uyry/G8SXzDRY0cXB3os0vKLSGmcAaFfdX4p3EvI5pk7S 82ejo4rA f1KyZJMB8ESf4t8y65UH9Fm2mil08hCqfZL3kvcgGWA6Fq2ak01i/62Y0d6/mnyn69ZsdrkGLeG5zc3OJLzo8ph2ucFc2j0BepfNyUxOWrwiN6GRUpjsUxSDhSRpUlagmOsVrRwmrJ/FG2LWa7/URutG3gZQzMfRJtUXu29gd1aAzurA6GCMMUk2OqHIwKrp+mJ75jYGL/Hdx9ENAf8E9xGtiaA== 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: List-Subscribe: List-Unsubscribe: On 2024/7/2 21:30, Mathieu Desnoyers wrote: > On 2024-07-02 07:55, Hongbo Li wrote: >> >> >> On 2024/7/2 7:49, Steven Rostedt wrote: >>> On Wed, 12 Jun 2024 09:11:56 +0800 >>> Hongbo Li wrote: >>> >>>> @@ -934,6 +943,12 @@ static int hugetlbfs_setattr(struct mnt_idmap >>>> *idmap, >>>>       if (error) >>>>           return error; >>>> +    trace_hugetlbfs_setattr(inode, dentry->d_name.len, >>>> dentry->d_name.name, >>>> +            attr->ia_valid, attr->ia_mode, >>>> +            from_kuid(&init_user_ns, attr->ia_uid), >>>> +            from_kgid(&init_user_ns, attr->ia_gid), >>>> +            inode->i_size, attr->ia_size); >>>> + >>> >>> That's a lot of parameters to pass to a tracepoint. Why not just pass >>> the >>> dentry and attr and do the above in the TP_fast_assign() logic? That >>> would >>> put less pressure on the icache for the code part. >> >> Thanks for reviewing! >> >> Some logic such as kuid_t --> uid_t might be reasonable obtained in >> filesystem layer. Passing the dentry and attr will let trace know the >> meaning of structure, perhaps tracepoint should not be aware of the >> members of these structures as much as possible. > > As maintainer of the LTTng out-of-tree kernel tracer, I appreciate the > effort to decouple instrumentation from the subsystem instrumentation, > but as long as the structure sits in public headers and the global > variables used within the TP_fast_assign() logic (e.g. init_user_ns) > are export-gpl, this is enough to make it easy for tracer integration Thank you for your friendly elaboration and suggestion! I will update this part based on your suggestion in next version. Thanks, Hongbo > and it keeps the tracepoint caller code footprint to a minimum. > > The TRACE_EVENT definitions are specific to the subsystem anyway, > so I don't think it matters that the TRACE_EVENT() need to access > the dentry and attr structures. > > So I agree with Steven's suggestion. However, just as a precision, > I suspect it will have mainly an impact on code size, but not > necessarily on icache footprint, because it will shrink the code > size within the tracepoint unlikely branch (cold instructions). > > Thanks, > > Mathieu > >> >> Thanks, >> Hongbo >> >>> >>> -- Steve >>> >