Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 2010 21:17:47 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 187168 for review
Message-ID:  <201012232117.oBNLHlGS033933@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@187168?ac=10

Change 187168 by trasz@trasz_victim on 2010/12/23 21:16:55

	Now that we keep a pointer to ucred for terminals, make RUSAGE_NPTS
	sloppy.  This means the per-ucred (per-jail, per-user etc) values are
	now right, although the per-process ones are meaningless.  Life is all
	about choices.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#43 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/tty_pts.c#23 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#43 (text+ko) ====

@@ -104,6 +104,7 @@
 	case RUSAGE_MEMLOCK:
 	case RUSAGE_NPROC:
 	case RUSAGE_SBSIZE:
+	case RUSAGE_NPTS:
 	case RUSAGE_SWAP:
 	case RUSAGE_NTHR:
 	case RUSAGE_NMSGQ:
@@ -140,6 +141,7 @@
 
 	switch (resource) {
 	case RUSAGE_SBSIZE:
+	case RUSAGE_NPTS:
 	case RUSAGE_SWAP:
 	case RUSAGE_NMSGQ:
 	case RUSAGE_MSGQQUEUED:

==== //depot/projects/soc2009/trasz_limits/sys/kern/tty_pts.c#23 (text+ko) ====

@@ -576,8 +576,6 @@
 	tty_lock(tp);
 	tty_rel_gone(tp);
 
-	rusage_sub(td->td_proc, RUSAGE_NPTS, 1);
-
 	/*
 	 * Open of /dev/ptmx or /dev/ptyXX changes the type of file
 	 * from DTYPE_VNODE to DTYPE_PTS. vn_open() increases vnode
@@ -685,6 +683,7 @@
 		free_unr(pts_pool, psc->pts_unit);
 
 	chgptscnt(psc->pts_cred->cr_ruidinfo, -1, 0);
+	rusage_sub_cred(psc->pts_cred, RUSAGE_NPTS, 1);
 	crfree(psc->pts_cred);
 
 	knlist_destroy(&psc->pts_inpoll.si_note);



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