mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <llong@redhat.com>
To: Al Viro <viro@zeniv.linux.org.uk>, Waiman Long <llong@redhat.com>
Cc: Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	linux-kernel@vger.kernel.org, audit@vger.kernel.org,
	Richard Guy Briggs <rgb@redhat.com>,
	Ricardo Robaina <rrobaina@redhat.com>
Subject: Re: [PATCH 1/2] audit: Quit audit_free_names() early if name list empty
Date: Wed, 21 Jan 2026 10:09:29 -0500	[thread overview]
Message-ID: <204e011a-582f-474a-980c-27c30620b8d7@redhat.com> (raw)
In-Reply-To: <20260121052623.GC3183987@ZenIV>

On 1/21/26 12:26 AM, Al Viro wrote:
> On Tue, Jan 20, 2026 at 11:08:45PM -0500, Waiman Long wrote:
>> On 1/20/26 10:11 PM, Al Viro wrote:
>>> On Tue, Jan 20, 2026 at 09:35:08PM -0500, Waiman Long wrote:
>>>> Optimize audit_free_names() by quitting early if the name list is empty.
>>>> This eliminates the need to acquire and release the fs_struct spinlock
>>>> in path_put().
>>> Why would path_put() go anywhere need fs_struct spinlock???
>>>
>> path_put() is defined in include/linux/fs_struct.h. It calls
>> read_seq{un}lock_excl(&fs->seq) which, in turn, acquires the releases the
>> spinlock underneath the seqlock_t.
> Really?  Which kernel would that be?  On mainline we have
>
> ; git grep -n -w path_put include/linux/fs_struct.h
> ; $ git grep -C 6 'void path_put\>' fs/namei.c
> fs/namei.c-/**
> fs/namei.c- * path_put - put a reference to a path
> fs/namei.c- * @path: path to put the reference to
> fs/namei.c- *
> fs/namei.c- * Given a path decrement the reference count to the dentry and the vfsmount.
> fs/namei.c- */
> fs/namei.c:void path_put(const struct path *path)
> fs/namei.c-{
> fs/namei.c-     dput(path->dentry);
> fs/namei.c-     mntput(path->mnt);
> fs/namei.c-}
> fs/namei.c-EXPORT_SYMBOL(path_put);
> fs/namei.c-
> ;
>
Sorry, my mistake. I mixed it up with get_fs_pwd(). Will fix the patch.

Cheers,
Longman


      reply	other threads:[~2026-01-21 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  2:35 Waiman Long
2026-01-21  2:35 ` [PATCH 2/2] audit: Call path_{put,get}() in audit_alloc_name()/audit_free_names() only when necessary Waiman Long
2026-01-21  3:11 ` [PATCH 1/2] audit: Quit audit_free_names() early if name list empty Al Viro
2026-01-21  4:08   ` Waiman Long
2026-01-21  5:26     ` Al Viro
2026-01-21 15:09       ` Waiman Long [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=204e011a-582f-474a-980c-27c30620b8d7@redhat.com \
    --to=llong@redhat.com \
    --cc=audit@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=rgb@redhat.com \
    --cc=rrobaina@redhat.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

all inboxes | Powered by JetHome®