lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 06 Mar 2013 17:03:42 +1100
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	"Michael S. Tsirkin" <mst@...hat.com>
Cc:	Paolo Bonzini <pbonzini@...hat.com>, Asias He <asias@...hat.com>,
	linux-kernel@...r.kernel.org,
	virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH 08/16] virtio_ring: virtqueue_add_outbuf / virtqueue_add_inbuf.

"Michael S. Tsirkin" <mst@...hat.com> writes:
>> Without the inline keywords, it doesn't inline virtqueue_add, and thus
>> sg_next_chained and sg_next_add aren't inlined:
>> 
>> $ for i in `seq 50`; do /usr/bin/time --format=%U ./vringh_test --indirect --eventidx --parallel; done 2>&1 | stats --trim-outliers
>> Using CPUS 0 and 3
>> Guest: notified 39102-39145(39105), pinged 39060-39063(39063)
>> Host: notified 39060-39063(39063), pinged 19551-19581(19553)
>> 3.050000-3.220000(3.136875)
>> 
>> With inline:
>> 
>> $ for i in `seq 50`; do /usr/bin/time --format=%U ./vringh_test --indirect --eventidx --parallel; done 2>&1 | stats --trim-outliers
>> Using CPUS 0 and 3
>> Guest: notified 39084-39148(39099), pinged 39062-39063(39062)
>> Host: notified 39062-39063(39062), pinged 19542-19574(19550)
>> 2.940000-3.140000(3.014583)
>> 
>> Cheers,
>> Rusty.
>
> Cool and did it actually unroll all loops?

Sorry for the delay in answering... I spent a day chasing red-herrings,
as my tests became limited by the vringh side, so optimizations on the
virtio side were having no effect :(

I'll answer a related question based on the current tree, where
virtio_add_outbuf (and virtio_add_inbuf) are the stars:

	return virtqueue_add(vq, &sg, sg_next_arr, num, 0, 1, 0, data, gfp);

Ideally, gcc would eliminated the input-descriptor loop altogether (that
0 for in_sgs), and unroll the 1-iteration output-descriptor loop into
straightline code.

Which it seems to have done, by my reading of the asm (at least, for gcc
4.7 on 32-bit x86).

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ