PERFORCE change 187810 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Fri Jan 14 20:16:51 UTC 2011
http://p4web.freebsd.org/@@187810?ac=10
Change 187810 by trasz at trasz_victim on 2011/01/14 20:15:53
It's log action that needs to be ratelimited, not signal. D'oh.
Affected files ...
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_rctl.c#5 edit
Differences ...
==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_rctl.c#5 (text+ko) ====
@@ -186,11 +186,6 @@
rctl_deferred_psignal(struct proc *p, int signum)
{
int need_lock;
- static int curtime = 0;
- static struct timeval lasttime;
-
- if (!ppsratecheck(&lasttime, &curtime, 10))
- return;
/*
* XXX: This is ugly. Either turn it into a real taskqueue,
@@ -288,6 +283,8 @@
struct sbuf sb;
int should_deny = 0;
char *buf;
+ static int curtime = 0;
+ static struct timeval lasttime;
mtx_lock(&rctl_lock);
@@ -307,6 +304,9 @@
should_deny = 1;
break;
case RCTL_ACTION_LOG:
+ if (!ppsratecheck(&lasttime, &curtime, 10))
+ break;
+
buf = malloc(RCTL_LOG_BUFSIZE, M_RCTL, M_NOWAIT);
if (buf == NULL) {
printf("rctl_enforce_proc: out of memory\n");
More information about the p4-projects
mailing list