Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Aug 2009 13:18:38 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 167402 for review
Message-ID:  <200908161318.n7GDIcqo066045@repoman.freebsd.org>

index | next in thread | raw e-mail

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

Change 167402 by trasz@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);
 }


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908161318.n7GDIcqo066045>