From: <Vineet.Gupta1@synopsys.com>
To: arnd@arndb.de
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
Vineet Gupta <Vineet.Gupta1@synopsys.com>
Subject: [PATCH 0/2] RFC only - allow arches to over-ride unit sized user copies
Date: Tue, 20 Nov 2012 20:08:15 +0530 [thread overview]
Message-ID: <1353422297-29079-1-git-send-email-vgupta@synopsys.com> (raw)
From: Vineet Gupta <vgupta@synopsys.com>
Hi Arnd,
The current asm-generic/uaccess unit copy interface __{get,put}_user( )
defaults to using __copy_{to,from}_user( ). For archs which don't support
unaligned access, latter typically involves generated code for alignment
checks.
It is expected that arch will provide a fast path in __copy_{to,from}_user( )
for such unit sized copies - probably using __builtin_const_p( ) etc -
however the alignment checks still can't be eliminated altogether using that.
Even if they could, it woudl make the implementation messier IMHO.
However given that 2 separate interfaces already exist form beginning
(i.e. __get_user vs. __copy_from_user) will it make sense to allow arch to
provide alternate implementation of former w/o having to mess with latter.
I did a quick hack to that end and I can see that savings are more than
just "noise".
bloat-o-meter vmlinux_pre_uaccess vmlinux_uaccess_part1 | head
add/remove: 0/1 grow/shrink: 10/62 up/down: 1502/-7256 (-5754)
The patch which converts just __get_user follows. I've not
done the full/clean version yet as this is just to gather feedback.
Thx,
-Vineet
Vineet Gupta (2):
asm-generic: uaccess: allow arch to over-ride __get_user_fn()
ARC: provide optimal __get_user_fn()
arch/arc/include/asm/uaccess.h | 51 ++++++++++++++++++++++++++++++++++++++++
include/asm-generic/uaccess.h | 5 ++++
2 files changed, 56 insertions(+), 0 deletions(-)
--
1.7.4.1
next reply other threads:[~2012-11-20 14:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 14:38 Vineet.Gupta1 [this message]
2012-11-20 14:38 ` [PATCH 1/2] asm-generic: uaccess: allow arch to over-ride __get_user_fn() Vineet.Gupta1
2012-11-20 14:38 ` Vineet.Gupta1
2012-11-20 15:55 ` Arnd Bergmann
2012-12-21 19:43 ` Arnd Bergmann
2012-12-24 5:50 ` Vineet Gupta
2012-11-20 14:38 ` [PATCH 2/2] ARC: provide optimal __get_user_fn() Vineet.Gupta1
2012-11-20 14:38 ` Vineet.Gupta1
2012-11-20 15:51 ` Arnd Bergmann
2012-12-21 4:33 ` Vineet Gupta
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=1353422297-29079-1-git-send-email-vgupta@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).