git: plan9front

Download patch

ref: 11cd33bcec9df077da672cfc2c49934ff3747f1f
parent: 706b44c15d09625d6c8ccf97b4690f423fccd9dd
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Jul 21 09:00:48 EDT 2024

kernel: make fixedpri work.

Fix and document the "fixedpri" control.

--- a/sys/man/3/proc
+++ b/sys/man/3/proc
@@ -355,6 +355,14 @@
 Set the base priority for the process to the integer
 .IR n .
 .TP 10n
+.B "fixedpri\ \fIn
+Fixate the process priority to the integer
+.IR n .
+In contrast to
+.BR pri ,
+the kernel will not automatically lower the priority
+based on the processes cpu usage.
+.TP 10n
 .B "wired\ \fIn
 Wire the process to processor
 .IR n .
--- a/sys/src/9/port/edf.c
+++ b/sys/src/9/port/edf.c
@@ -531,9 +531,8 @@
 				 * best effort
 				 */
 				DPRINT(">");
-				p->basepri = PriExtra;
-				p->fixedpri = 1;
 				edfunlock();
+				procpriority(p, PriExtra, 1);
 				return 0;	/* Stick on runq[PriExtra] */
 			}
 			DPRINT("%lud edfready %lud[%s] wait release at %lud\n",
--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -351,6 +351,9 @@
 
 	updatecpu(p);
 
+	if(p->fixedpri)
+		return p->basepri;
+
 	load = MACHP(0)->load;
 	if(load == 0)
 		return p->basepri;
--