Blaisorblade wrote:
On Wednesday 23 March 2005 18:09, Bodo Stroesser wrote:

[EMAIL PROTECTED] wrote:

Use rep_nop instead of barrier for cpu_relax, following $(SUBARCH)'s
doing that (i.e. i386 and x86_64).

IIRC, Jeff had the idea, to use sched_yield() for this (from a discussion on #uml).

Hmm, makes sense, but this is to benchmark well... I remember from early discussions on 2.6 scheduler that using sched_yield might decrease performance (IIRC starve the calling application).



Typically, for places where cpu_relax is used, sched_yield would be a poor fit. So yes it could easily reduce performance.

Also, that call should be put inside the idle loop, not for cpu_relax, which is very different, since it is used (for instance) in kernel/spinlock.c for spinlocks, and in such things. The "Pause" opcode is explicitly recommended (by Intel manuals, I don't recall why) for things like spinlock loops, and using yield there would be bad.


The other thing is that sched_yield won't relax at all if you are the only thing running, it will be a busy wait. So again, maybe not a great fit for the idle loop either.





-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to