Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 10:48:10 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244251 - projects/calloutng/sys/kern
Message-ID:  <201212151048.qBFAmAvK040483@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Dec 15 10:48:10 2012
New Revision: 244251
URL: http://svnweb.freebsd.org/changeset/base/244251

Log:
  Specify that precision of 0.5s is enough for resource limitation.

Modified:
  projects/calloutng/sys/kern/kern_resource.c

Modified: projects/calloutng/sys/kern/kern_resource.c
==============================================================================
--- projects/calloutng/sys/kern/kern_resource.c	Sat Dec 15 10:46:57 2012	(r244250)
+++ projects/calloutng/sys/kern/kern_resource.c	Sat Dec 15 10:48:10 2012	(r244251)
@@ -645,7 +645,7 @@ lim_cb(void *arg)
 		}
 	}
 	if ((p->p_flag & P_WEXIT) == 0)
-		callout_reset(&p->p_limco, hz, lim_cb, p);
+		callout_reset_flags(&p->p_limco, hz, lim_cb, p, C_PRELSET(1));
 }
 
 int
@@ -697,7 +697,8 @@ kern_proc_setrlimit(struct thread *td, s
 	case RLIMIT_CPU:
 		if (limp->rlim_cur != RLIM_INFINITY &&
 		    p->p_cpulimit == RLIM_INFINITY)
-			callout_reset(&p->p_limco, hz, lim_cb, p);
+			callout_reset_flags(&p->p_limco, hz, lim_cb, p,
+			    C_PRELSET(1));
 		p->p_cpulimit = limp->rlim_cur;
 		break;
 	case RLIMIT_DATA:
@@ -1137,7 +1138,7 @@ lim_fork(struct proc *p1, struct proc *p
 	p2->p_limit = lim_hold(p1->p_limit);
 	callout_init_mtx(&p2->p_limco, &p2->p_mtx, 0);
 	if (p1->p_cpulimit != RLIM_INFINITY)
-		callout_reset(&p2->p_limco, hz, lim_cb, p2);
+		callout_reset_flags(&p2->p_limco, hz, lim_cb, p2, C_PRELSET(1));
 }
 
 void



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