PERFORCE change 188344 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Sun Jan 30 16:11:48 UTC 2011


http://p4web.freebsd.org/@@188344?ac=10

Change 188344 by trasz at trasz_victim on 2011/01/30 16:11:02

	Instead of P_THROTTLED flag and kicking processes into idle scheduling
	class and back we'll need something less aggressive.  This is just a WIP,
	since p4 doesn't have 'stash' functionality.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#69 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/proc.h#32 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#69 (text+ko) ====

@@ -773,11 +773,11 @@
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 
 	if (throttle) {
-		p->p_flag |= P_THROTTLED;
+		p->p_throttle++;
 		newpri = PRI_MIN_IDLE;
 		type = RTP_PRIO_IDLE;
-	} else if (p->p_flag & P_THROTTLED) {
-		p->p_flag &= ~P_THROTTLED;
+	} else if (p->p_throttle > 0) {
+		p->p_throttle--;
 		newpri = PRI_MIN_TIMESHARE;
 		type = RTP_PRIO_NORMAL;
 	} else

==== //depot/projects/soc2009/trasz_limits/sys/sys/proc.h#32 (text+ko) ====

@@ -546,6 +546,7 @@
 	rlim_t		p_cpulimit;	/* (c) Current CPU limit in seconds. */
 	signed char	p_nice;		/* (c) Process "nice" value. */
 	int		p_fibnum;	/* in this routing domain XXX MRT */
+	u_int		p_throttle;	/* (c) Resource usage accounting. */
 /* End area that is copied on creation. */
 #define	p_endcopy	p_xstat
 
@@ -611,7 +612,6 @@
 #define	P_INMEM		0x10000000 /* Loaded into memory. */
 #define	P_SWAPPINGOUT	0x20000000 /* Process is being swapped out. */
 #define	P_SWAPPINGIN	0x40000000 /* Process is being swapped in. */
-#define	P_THROTTLED	0x80000000 /* Throttled due to %cpu usage */
 
 #define	P_STOPPED	(P_STOPPED_SIG|P_STOPPED_SINGLE|P_STOPPED_TRACE)
 #define	P_SHOULDSTOP(p)	((p)->p_flag & P_STOPPED)


More information about the p4-projects mailing list