From owner-p4-projects@FreeBSD.ORG Fri Jan 14 20:16:50 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AF7871065674; Fri, 14 Jan 2011 20:16:50 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72533106564A for ; Fri, 14 Jan 2011 20:16:50 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 5F36F8FC16 for ; Fri, 14 Jan 2011 20:16:50 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p0EKGo2T012189 for ; Fri, 14 Jan 2011 20:16:50 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p0EKGoBV012186 for perforce@freebsd.org; Fri, 14 Jan 2011 20:16:50 GMT (envelope-from trasz@freebsd.org) Date: Fri, 14 Jan 2011 20:16:50 GMT Message-Id: <201101142016.p0EKGoBV012186@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 187810 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 20:16:51 -0000 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");