Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread Kfir Lavi
On Sun, Jul 17, 2011 at 7:19 PM, Daniel da Veiga wrote:

> On Sat, Jul 16, 2011 at 10:54, Kfir Lavi  wrote:
>
>> Hi,
>> I'm creating a router based on Gentoo, that needs to run as a vm using
>> qemu.
>> The mother machine will be Core I7 4 cores.
>> What cpu and CFLAGS should I use to get the best performance out of this
>> vm?
>>
>>
> If you intend to run this VM on different hardware or distribute it in any
> way (so you don't really know on what hardware it will run) your best bet is
> to set a generic arch like i686 or lower, OR hope the VM is run on software
> based emulation (slow) so you don't have to worry about what CPU is running
> it.
>
> From my experience with qemu, you'll have a lot of requirements too, like
> bridging and kernel module for virtual interfaces (tun/tap).
>
> Now, if this will run on your machine, with kqemu, you'll set march on your
> guest  as your host is...
>
> --
> Daniel da Veiga
>

I'll build each router for its box. I don't want to use i686 as I'll run
also on Atom, and this comp is really really slow with kvm support.

Kfir


Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread Daniel da Veiga
On Sat, Jul 16, 2011 at 10:54, Kfir Lavi  wrote:

> Hi,
> I'm creating a router based on Gentoo, that needs to run as a vm using
> qemu.
> The mother machine will be Core I7 4 cores.
> What cpu and CFLAGS should I use to get the best performance out of this
> vm?
>
>
If you intend to run this VM on different hardware or distribute it in any
way (so you don't really know on what hardware it will run) your best bet is
to set a generic arch like i686 or lower, OR hope the VM is run on software
based emulation (slow) so you don't have to worry about what CPU is running
it.

>From my experience with qemu, you'll have a lot of requirements too, like
bridging and kernel module for virtual interfaces (tun/tap).

Now, if this will run on your machine, with kqemu, you'll set march on your
guest  as your host is...

-- 
Daniel da Veiga


Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread Stroller

On 17 July 2011, at 13:02, Albert Hopkins wrote:
> On Saturday, July 16 at 16:54 (+0300), Kfir Lavi said:
> 
>> The mother machine will be Core I7 4 cores.
>> What cpu and CFLAGS should I use to get the best performance out of this vm?
> 
> A router is not going to be CPU-bound.  Should matter little either way.

A router is not going to be CPU-bound *on the most modern of hardware*, with no 
other load.

An old WRT54G will be CPU-bound on the latest high speed home connections (c 
40meg), and I have at least one older PC, maybe 10 years old, still in use, on 
which performance could be an issue.

Your statement may apply to Kfir's Core I7 system, but it one should be careful 
against making such bold statements, less words like "not" be misunderstood be 
to mean "never".

Stroller.




Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread Michael Mol
On Sun, Jul 17, 2011 at 8:02 AM, Albert Hopkins  wrote:
> On Saturday, July 16 at 16:54 (+0300), Kfir Lavi said:
>> The mother machine will be Core I7 4 cores.
>> What cpu and CFLAGS should I use to get the best performance out of this vm?
>
> A router is not going to be CPU-bound.  Should matter little either way.

I agree it's not likely to matter significantly. In a VM environment,
though, it could conceivably be routing traffic between other VM
guests, and the nature of their locality could easily result in higher
traffic flows than you'd ever see running across a wire. Depends on
the use case, I imagine.

-- 
:wq



Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread Albert Hopkins


On Saturday, July 16 at 16:54 (+0300), Kfir Lavi said:


> The mother machine will be Core I7 4 cores.
> What cpu and CFLAGS should I use to get the best performance out of this vm?

A router is not going to be CPU-bound.  Should matter little either way.




Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread dong l
qemu has an option `*qemu* -*cpu host` that will use the host cpu features*

2011/7/17 Kfir Lavi 

>
>
> On Sat, Jul 16, 2011 at 9:13 PM, Michael Orlitzky wrote:
>
>> On 07/16/2011 09:54 AM, Kfir Lavi wrote:
>> > Hi,
>> > I'm creating a router based on Gentoo, that needs to run as a vm using
>> > qemu.
>> > The mother machine will be Core I7 4 cores.
>> > What cpu and CFLAGS should I use to get the best performance out of this
>> vm?
>> >
>> > Thanks,
>> > Kfir
>>
>> CFLAGS="-march=native -O2 -pipe" enables everything safe these days.
>>
>> Hi,
> I think -march=native is a problem, as it will compile for my cpu.
> Qemu has different CPU, and i would like to compile my code to suit the vm
> environment
> as close as possible.
>
> Kfir
>


Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread Kfir Lavi
On Sat, Jul 16, 2011 at 9:13 PM, Michael Orlitzky wrote:

> On 07/16/2011 09:54 AM, Kfir Lavi wrote:
> > Hi,
> > I'm creating a router based on Gentoo, that needs to run as a vm using
> > qemu.
> > The mother machine will be Core I7 4 cores.
> > What cpu and CFLAGS should I use to get the best performance out of this
> vm?
> >
> > Thanks,
> > Kfir
>
> CFLAGS="-march=native -O2 -pipe" enables everything safe these days.
>
> Hi,
I think -march=native is a problem, as it will compile for my cpu.
Qemu has different CPU, and i would like to compile my code to suit the vm
environment
as close as possible.

Kfir


Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-17 Thread Neil Bothwick
On Sat, 16 Jul 2011 14:13:49 -0400, Michael Orlitzky wrote:

> CFLAGS="-march=native -O2 -pipe" enables everything safe these days.

As long as you don't want the VM to be portable.


-- 
Neil Bothwick

Angular Momentum Makes The World Go 'Round


signature.asc
Description: PGP signature


Re: [gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-16 Thread Michael Orlitzky
On 07/16/2011 09:54 AM, Kfir Lavi wrote:
> Hi,
> I'm creating a router based on Gentoo, that needs to run as a vm using
> qemu.
> The mother machine will be Core I7 4 cores.
> What cpu and CFLAGS should I use to get the best performance out of this vm?
> 
> Thanks,
> Kfir

CFLAGS="-march=native -O2 -pipe" enables everything safe these days.



[gentoo-user] best cflags and cpu for gentoo qemu virtual machine

2011-07-16 Thread Kfir Lavi
Hi,
I'm creating a router based on Gentoo, that needs to run as a vm using qemu.

The mother machine will be Core I7 4 cores.
What cpu and CFLAGS should I use to get the best performance out of this vm?

Thanks,
Kfir