Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jan 2011 20:16:50 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 187810 for review
Message-ID:  <201101142016.p0EKGoBV012186@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help

http://p4web.freebsd.org/@@187810?ac=10

Change 187810 by trasz@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");



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