linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hongbo Li <lihongbo22@huawei.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: <muchun.song@linux.dev>, <mhiramat@kernel.org>,
	<linux-mm@kvack.org>, <linux-trace-kernel@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 2/2] hugetlbfs: use tracepoints in hugetlbfs functions.
Date: Tue, 2 Jul 2024 22:21:00 +0800	[thread overview]
Message-ID: <5856cee4-1e13-4c67-8fea-f5f938f7452f@huawei.com> (raw)
In-Reply-To: <8015a0bf-39e2-406c-8f61-db87a40a71a3@efficios.com>



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 <lihongbo22@huawei.com> 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
>>>
> 


      reply	other threads:[~2024-07-02 14:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12  1:11 [PATCH 0/2] Introduce tracepoint for hugetlbfs Hongbo Li
2024-06-12  1:11 ` [PATCH 1/2] hugetlbfs: support tracepoint Hongbo Li
2024-06-12  1:11 ` [PATCH 2/2] hugetlbfs: use tracepoints in hugetlbfs functions Hongbo Li
2024-06-20 11:50   ` Hongbo Li
2024-07-01 23:49   ` Steven Rostedt
2024-07-02 11:55     ` Hongbo Li
2024-07-02 13:30       ` Mathieu Desnoyers
2024-07-02 14:21         ` Hongbo Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5856cee4-1e13-4c67-8fea-f5f938f7452f@huawei.com \
    --to=lihongbo22@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).