* [PATCH] vhost: copy_from_user -> __copy_from_user
@ 2011-03-06 11:33 Michael S. Tsirkin
2011-03-07 2:03 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2011-03-06 11:33 UTC (permalink / raw)
To: Michael S. Tsirkin, kvm, virtualization, netdev, linux-kernel
copy_from_user is pretty high on perf top profile,
replacing it with __copy_from_user helps.
It's also safe because we do access_ok checks during setup.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/vhost/vhost.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index ade0568..01701b8 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1153,7 +1153,7 @@ int vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq,
i, vq->num, head);
return -EINVAL;
}
- ret = copy_from_user(&desc, vq->desc + i, sizeof desc);
+ ret = __copy_from_user(&desc, vq->desc + i, sizeof desc);
if (unlikely(ret)) {
vq_err(vq, "Failed to get descriptor: idx %d addr %p\n",
i, vq->desc + i);
--
1.7.3.2.91.g446ac
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] vhost: copy_from_user -> __copy_from_user
2011-03-06 11:33 [PATCH] vhost: copy_from_user -> __copy_from_user Michael S. Tsirkin
@ 2011-03-07 2:03 ` David Miller
2011-03-07 6:30 ` Michael S. Tsirkin
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2011-03-07 2:03 UTC (permalink / raw)
To: mst; +Cc: kvm, virtualization, netdev, linux-kernel
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Sun, 6 Mar 2011 13:33:49 +0200
> copy_from_user is pretty high on perf top profile,
> replacing it with __copy_from_user helps.
> It's also safe because we do access_ok checks during setup.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Is Rusty going to take this or should I?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vhost: copy_from_user -> __copy_from_user
2011-03-07 2:03 ` David Miller
@ 2011-03-07 6:30 ` Michael S. Tsirkin
0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2011-03-07 6:30 UTC (permalink / raw)
To: David Miller; +Cc: kvm, virtualization, netdev, linux-kernel
On Sun, Mar 06, 2011 at 06:03:39PM -0800, David Miller wrote:
> From: "Michael S. Tsirkin" <mst@redhat.com>
> Date: Sun, 6 Mar 2011 13:33:49 +0200
>
> > copy_from_user is pretty high on perf top profile,
> > replacing it with __copy_from_user helps.
> > It's also safe because we do access_ok checks during setup.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> Is Rusty going to take this or should I?
Sorry about not making this clear. I'll give it a day or two for review
then put it on the vhost tree myself.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-07 6:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-06 11:33 [PATCH] vhost: copy_from_user -> __copy_from_user Michael S. Tsirkin
2011-03-07 2:03 ` David Miller
2011-03-07 6:30 ` Michael S. Tsirkin
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).