From: "David S. Miller" <davem@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: viro@parcelfarce.linux.theplanet.co.uk
Subject: stat very inefficient
Date: Tue, 27 Jul 2004 20:13:01 -0700 [thread overview]
Message-ID: <20040727201301.2723f5ad.davem@redhat.com> (raw)
All of the *stat*() syscall routines copy the inode attributes
around a whopping _3_ times before they get to userspace.
1) From inode to "struct kstat"
2) From "struct kstat" to "struct stat{,64}" on local kernel stack
3) From local kernel stack to userspace
That's rediculious. And also the stores into the various
structures are not done in ascending order and thus all of
the store buffers on various cpus never get a reasonable
store stream for maximal store buffer compression.
The reason things happen this way is that each implementation
of the various stat structures have padding in different places
and/or have other layout issues. The simplest thing to do
is memset() the thing, fill in the non-pad parts, and copy
it into user space.
We should be able to do this with just 2 copies as I recognize
the reason why the struct kstat abstraction exists.
I was about to make sparc64 specific copies of all the stat
system calls in order to optimize this properly. But that
makes little sense, instead I think fs/stat.c should call
upon arch-specific stat{,64} structure fillin routines that
can do the magic, given a kstat struct.
Comments?
next reply other threads:[~2004-07-28 3:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-28 3:13 David S. Miller [this message]
2004-07-28 18:07 ` stat very inefficient viro
[not found] <2mN94-3MP-9@gated-at.bofh.it>
2004-07-28 10:16 ` Andi Kleen
2004-07-28 15:38 ` David S. Miller
[not found] <233602095@toto.iv>
2004-07-28 22:33 ` Peter Chubb
2004-07-28 22:45 ` David S. Miller
2004-07-29 0:08 ` Chris Wedgwood
2004-07-29 0:14 ` David S. Miller
2004-07-29 0:24 ` Chris Wedgwood
2004-07-29 0:29 ` viro
2004-07-29 7:26 ` Peter Chubb
2004-07-29 7:42 ` Andrew Morton
2004-07-29 8:49 ` Paul Jackson
2004-07-29 9:02 ` Andrew Morton
2004-07-29 9:17 ` Peter Chubb
2004-07-29 7:45 ` Ulrich Drepper
2004-07-29 11:42 ` Nigel Rantor
2004-07-29 1:07 ` Ulrich Drepper
2004-07-29 2:22 ` Paul Jackson
2004-07-29 4:10 ` Ulrich Drepper
2004-07-29 6:18 ` Paul Jackson
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=20040727201301.2723f5ad.davem@redhat.com \
--to=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@parcelfarce.linux.theplanet.co.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