PERFORCE change 185759 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Sat Nov 13 21:57:51 UTC 2010
http://p4web.freebsd.org/@@185759?ac=10
Change 185759 by trasz at 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);
More information about the p4-projects
mailing list