Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755035AbcDIUOm (ORCPT ); Sat, 9 Apr 2016 16:14:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37949 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752779AbcDIUOl (ORCPT ); Sat, 9 Apr 2016 16:14:41 -0400 Date: Sat, 9 Apr 2016 23:14:37 +0300 From: "Michael S. Tsirkin" To: Denys Vlasenko Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/virtio/virtio_ring.c: Deinline virtqueue_add, save 1016 bytes Message-ID: <20160409231155-mutt-send-email-mst@redhat.com> References: <1460141926-13069-1-git-send-email-dvlasenk@redhat.com> <1460141926-13069-3-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460141926-13069-3-git-send-email-dvlasenk@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1204 Lines: 35 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 > CC: "Michael S. Tsirkin" > 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