Linux filesystem development
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] vfs: inline getname()
Date: Thu, 6 Feb 2025 20:11:28 +0300	[thread overview]
Message-ID: <6cfcd262-0fe4-4398-999c-ade674191edf@p183> (raw)
In-Reply-To: <CACVxJT_Qy8uWVn5dESZo8LDj_VSLAhkFfxNaTkD6ZwvYARVo3Q@mail.gmail.com>

[cc lists and people]

> +static inline struct filename *getname(const char __user *name)
> +{
> + return getname_flags(name, 0);
> +}

This may be misguided. The reason is that if function is used often enough
then all those clears of the second argument bloat icache at the call sites.
Uninlining moves all clears in one place, shrinking callers at the cost of
additional function which (in this case) tail calls into another function.
And tailcalling is quite efficient (essentially free):

	getname:
		xor esi, esi
		jmp getname_flags

       reply	other threads:[~2025-02-06 17:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACVxJT_Qy8uWVn5dESZo8LDj_VSLAhkFfxNaTkD6ZwvYARVo3Q@mail.gmail.com>
2025-02-06 17:11 ` Alexey Dobriyan [this message]
2025-02-06 18:03   ` [PATCH] vfs: inline getname() Mateusz Guzik
2025-02-06  0:01 Mateusz Guzik
2025-02-06  9:02 ` Jan Kara
2025-02-06  9:22 ` Christian Brauner

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=6cfcd262-0fe4-4398-999c-ade674191edf@p183 \
    --to=adobriyan@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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