Re: [uml-devel] [patch 02/12] uml: cpu_relax fix

From: Bodo Stroesser
Date: Wed Mar 23 2005 - 12:11:09 EST


blaisorblade@xxxxxxxx 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).
S390 does something similar using a special DIAG-opcode that gives permission to zVM,
that another Guest might run.

On a host running many UMLs, this might improve performance.

So, I would like to have the small patch below (it's not tested, just an idea).

Bodo


diff -puN include/asm-um/processor-generic.h~uml-cpu_relax include/asm-um/processor-generic.h
--- linux-2.6.11/include/asm-um/processor-generic.h~uml-cpu_relax 2005-03-22 16:52:25.000000000 +0100
+++ linux-2.6.11-paolo/include/asm-um/processor-generic.h 2005-03-22 16:54:41.000000000 +0100
@@ -16,7 +16,8 @@ struct task_struct;
struct mm_struct;
-#define cpu_relax() barrier()
+#include "kern.h"
+#define cpu_relax() sched_yield()
struct thread_struct {
int forking;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/