* [PATCH] drivers/virtio/virtio_ring.c: Deinline virtqueue_add, save 1016 bytes [not found] <1460141926-13069-1-git-send-email-dvlasenk@redhat.com> @ 2016-04-08 18:58 ` Denys Vlasenko [not found] ` <1460141926-13069-3-git-send-email-dvlasenk@redhat.com> 1 sibling, 0 replies; 2+ messages in thread From: Denys Vlasenko @ 2016-04-08 18:58 UTC (permalink / raw) To: Michael S. Tsirkin; +Cc: Denys Vlasenko, linux-kernel, virtualization This function compiles to 839 bytes of machine code. In C, it is ~150 lines long. This function has 3 callsites. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com> CC: "Michael S. Tsirkin" <mst@redhat.com> CC: virtualization@lists.linux-foundation.org CC: linux-kernel@vger.kernel.org --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index e12e385..77a4771 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -126,7 +126,7 @@ static struct vring_desc *alloc_indirect(struct virtqueue *_vq, return desc; } -static inline int virtqueue_add(struct virtqueue *_vq, +static int virtqueue_add(struct virtqueue *_vq, struct scatterlist *sgs[], unsigned int total_sg, unsigned int out_sgs, -- 2.1.0 ^ permalink raw reply related [flat|nested] 2+ messages in thread
[parent not found: <1460141926-13069-3-git-send-email-dvlasenk@redhat.com>]
* Re: [PATCH] drivers/virtio/virtio_ring.c: Deinline virtqueue_add, save 1016 bytes [not found] ` <1460141926-13069-3-git-send-email-dvlasenk@redhat.com> @ 2016-04-09 20:14 ` Michael S. Tsirkin 0 siblings, 0 replies; 2+ messages in thread From: Michael S. Tsirkin @ 2016-04-09 20:14 UTC (permalink / raw) To: Denys Vlasenko; +Cc: linux-kernel, virtualization On Fri, Apr 08, 2016 at 08:58:44PM +0200, Denys Vlasenko wrote: > This function compiles to 839 bytes of machine code. > In C, it is ~150 lines long. > > This function has 3 callsites. > > Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com> > CC: "Michael S. Tsirkin" <mst@redhat.com> > CC: virtualization@lists.linux-foundation.org > CC: linux-kernel@vger.kernel.org This function is one of the most performance critical ones in the driver, a bunch of tuning went into it, making this inline intentionally. I'd have to see some numbers showing making it non-inline is a worth-while tradeoff. > --- > drivers/virtio/virtio_ring.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index e12e385..77a4771 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -126,7 +126,7 @@ static struct vring_desc *alloc_indirect(struct virtqueue *_vq, > return desc; > } > > -static inline int virtqueue_add(struct virtqueue *_vq, > +static int virtqueue_add(struct virtqueue *_vq, > struct scatterlist *sgs[], > unsigned int total_sg, > unsigned int out_sgs, > -- > 2.1.0 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-09 20:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1460141926-13069-1-git-send-email-dvlasenk@redhat.com>
2016-04-08 18:58 ` [PATCH] drivers/virtio/virtio_ring.c: Deinline virtqueue_add, save 1016 bytes Denys Vlasenko
[not found] ` <1460141926-13069-3-git-send-email-dvlasenk@redhat.com>
2016-04-09 20:14 ` 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