Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Nov 2010 21:57:50 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 185759 for review
Message-ID:  <201011132157.oADLvoNc055794@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@185759?ac=10

Change 185759 by trasz@trasz_victim on 2010/11/13 21:57:28

	I think there is nothing wrong with allowing zero amount.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#36 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/uipc_sockbuf.c#5 edit

Differences ...

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

@@ -409,7 +409,7 @@
 
 	SDT_PROBE(container, kernel, rusage, add, p, resource, amount, 0, 0);
 
-	KASSERT(amount > 0, ("rusage_add: invalid amount for resource %d: %ju",
+	KASSERT(amount >= 0, ("rusage_add: invalid amount for resource %d: %ju",
 	    resource, amount));
 
 	mtx_lock(&container_lock);
@@ -437,7 +437,7 @@
 
 	SDT_PROBE(container, kernel, rusage, add_cred, cred, resource, amount, 0, 0);
 
-	KASSERT(amount > 0, ("rusage_add_cred: invalid amount for resource %d: %ju",
+	KASSERT(amount >= 0, ("rusage_add_cred: invalid amount for resource %d: %ju",
 	    resource, amount));
 	KASSERT(container_resource_sloppy(resource),
 	    ("rusage_add_cred: called for non-sloppy resource %d", resource));
@@ -462,7 +462,7 @@
 
 	SDT_PROBE(container, kernel, rusage, add_force, p, resource, amount, 0, 0);
 
-	KASSERT(amount > 0, ("rusage_add_force: invalid amount for resource %d: %ju",
+	KASSERT(amount >= 0, ("rusage_add_force: invalid amount for resource %d: %ju",
 	    resource, amount));
 
 	mtx_lock(&container_lock);
@@ -553,7 +553,7 @@
 
 	SDT_PROBE(container, kernel, rusage, sub, p, resource, amount, 0, 0);
 
-	KASSERT(amount > 0, ("rusage_sub: invalid amount for resource %d: %ju",
+	KASSERT(amount >= 0, ("rusage_sub: invalid amount for resource %d: %ju",
 	    resource, amount));
 	KASSERT(container_resource_reclaimable(resource),
 	    ("rusage_sub: called for non-reclaimable resource %d", resource));
@@ -577,7 +577,7 @@
 
 	SDT_PROBE(container, kernel, rusage, sub_cred, cred, resource, amount, 0, 0);
 
-	KASSERT(amount > 0, ("rusage_sub_cred: invalid amount for resource %d: %ju",
+	KASSERT(amount >= 0, ("rusage_sub_cred: invalid amount for resource %d: %ju",
 	    resource, amount));
 	KASSERT(container_resource_reclaimable(resource),
 	    ("rusage_sub_cred: called for non-reclaimable resource %d", resource));

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

@@ -354,8 +354,7 @@
 
 	sbflush_internal(sb);
 #ifdef CONTAINERS
-	if (sb->sb_hiwat != 0)
-		rusage_sub_cred(so->so_cred, RUSAGE_SBSIZE, sb->sb_hiwat);
+	rusage_sub_cred(so->so_cred, RUSAGE_SBSIZE, sb->sb_hiwat);
 #endif
 	(void)chgsbsize(so->so_cred->cr_uidinfo, &sb->sb_hiwat, 0,
 	    RLIM_INFINITY);



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