Re: [PATCH 4/4] virtio_ring: unify direct/indirect code paths.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 29, 2014 at 08:35:58PM +0930, Rusty Russell wrote:
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> writes:
> > On Thu, May 29, 2014 at 04:56:45PM +0930, Rusty Russell wrote:
> >> Before:
> >> 	gcc 4.8.2: virtio_blk: stack used = 392
> >> 	gcc 4.6.4: virtio_blk: stack used = 480
> >> 
> >> After:
> >> 	gcc 4.8.2: virtio_blk: stack used = 408
> >> 	gcc 4.6.4: virtio_blk: stack used = 432
> >
> > Is it worth it to make the good compiler worse? People are going to use
> > the newer GCC more as time goes on anyhow.
> 
> No, but it's only 16 bytes of stack loss for a simplicity win:
> 
>  virtio_ring.c |  120 +++++++++++++++++++++-------------------------------------
>  1 file changed, 45 insertions(+), 75 deletions(-)
> 
> Cheers,
> Rusty.

I'm concerned that we are doing an extra descriptor walk now though.
And desc == &vq.desc at the end is kind of ugly too.

How about
		if (indirect)
                        vq->vring.desc[i].next = i + 1;
		else
                        i = vq->vring.desc[i].next;

or something like this?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]