From: David Howells <dhowells@redhat.com>
To: "Ulrich Drepper" <drepper@gmail.com>
Cc: dhowells@redhat.com, viro@ftp.linux.org.uk, hch@infradead.org,
torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: Credentials test patch
Date: Mon, 17 Sep 2007 12:02:12 +0100 [thread overview]
Message-ID: <19877.1190026932@redhat.com> (raw)
In-Reply-To: <a36005b50709150851s52d04554t62d53dab3f47eaf8@mail.gmail.com>
Ulrich Drepper <drepper@gmail.com> wrote:
> In sys_faccessat you temporarily allocate a cred object which is
> discarded in the end. With a few more macro definitions you could
> create a dup_cred variant which initialized an automatic variable of
> type struct cred. This way the kmalloc/kfree pair would fall away.
No, you can't. The filesystems sys_faccessat() then invokes are entitled to
take a reference to it - the SunRPC authentication stuff, for example - so you
can't just preemptively unallocate it as would occur with an automatic variable.
> access is actually used frequently. For instance, ld.so uses it on
> every startup as a quicker possibility to check for a file which
> usually doesn't exist. So, speeding up access has some small effect
> on performance. The resulting code might actually reduce the kernel
> size a bit due to all the checks and calls which go away.
A better way would be to compare fsuid/fsgid to uid/gid and to just take an
extra ref on the incumbent cred object if they're the same, rather than always
allocating a new one. That, I suspect, would speed up 99.99% of the cases.
David
next prev parent reply other threads:[~2007-09-17 11:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-13 19:56 Credentials test patch David Howells
2007-09-13 20:09 ` Linus Torvalds
2007-09-13 21:19 ` David Howells
2007-09-13 21:33 ` Linus Torvalds
2007-09-15 15:51 ` Ulrich Drepper
2007-09-17 11:02 ` David Howells [this message]
2007-09-17 14:28 ` Ulrich Drepper
2007-09-17 15:27 ` David Howells
2007-09-18 16:33 ` David Howells
2007-09-18 16:44 ` Trond Myklebust
2007-09-18 17:25 ` David Howells
2007-09-18 17:58 ` Casey Schaufler
2007-09-18 18:03 ` Trond Myklebust
2007-09-18 18:24 ` David Howells
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=19877.1190026932@redhat.com \
--to=dhowells@redhat.com \
--cc=drepper@gmail.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=viro@ftp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.