PERFORCE change 167402 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Sun Aug 16 13:18:39 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=167402

Change 167402 by trasz at trasz_anger on 2009/08/16 13:18:36

	Enable some KASSERTs.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#59 edit

Differences ...

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

@@ -120,14 +120,6 @@
 
 MALLOC_DEFINE(M_HRL, "hrl", "Hierarchical Resource Limits");
 
-#if 0
-#undef KASSERT
-#define	KASSERT(exp,msg) do {                                           \
-        if (__predict_false(!(exp)))                                    \
-                printf msg;                                             \
-} while (0)
-#endif
-
 #ifdef INVARIANTS
 /*
  * Go through the resource usage info and verify that it makes sense.
@@ -647,17 +639,13 @@
 
 	mtx_lock(&hrl_lock);
 	for (i = 0; i < HRL_RESOURCE_MAX; i++) {
-#ifdef notyet
 		KASSERT(dest->hu_resources[i] >= 0,
 		    ("resource usage propagation meltdown"));
 		KASSERT(src->hu_resources[i] >= 0,
 		    ("resource usage propagation meltdown"));
-#endif
 		dest->hu_resources[i] += src->hu_resources[i];
-#ifdef notyet
 		KASSERT(dest->hu_resources[i] >= 0,
 		    ("resource usage propagation meltdown"));
-#endif
 	}
 	mtx_unlock(&hrl_lock);
 }
@@ -669,19 +657,15 @@
 
 	mtx_lock(&hrl_lock);
 	for (i = 0; i < HRL_RESOURCE_MAX; i++) {
-#ifdef notyet
 		KASSERT(dest->hu_resources[i] >= 0,
 		    ("resource usage propagation meltdown"));
 		KASSERT(src->hu_resources[i] >= 0,
 		    ("resource usage propagation meltdown"));
 		KASSERT(src->hu_resources[i] <= dest->hu_resources[i],
 		    ("resource usage propagation meltdown"));
-#endif
 		dest->hu_resources[i] -= src->hu_resources[i];
-#ifdef notyet
 		KASSERT(dest->hu_resources[i] >= 0,
 		    ("resource usage propagation meltdown"));
-#endif
 	}
 	mtx_unlock(&hrl_lock);
 }


More information about the p4-projects mailing list