[Glibc-bsd-commits] r4768 - in trunk/kfreebsd-9/debian: . patches

Petr Salinger ps-guest at alioth.debian.org
Fri Jul 19 16:59:05 UTC 2013


Author: ps-guest
Date: 2013-07-19 16:59:05 +0000 (Fri, 19 Jul 2013)
New Revision: 4768

Added:
   trunk/kfreebsd-9/debian/patches/000_zombie.diff
Modified:
   trunk/kfreebsd-9/debian/changelog
   trunk/kfreebsd-9/debian/patches/series
   trunk/kfreebsd-9/debian/rules
Log:
* Build by gcc-4.8, disable unnecessary 901_disable_optimization_2.diff
* Add backport of CPU-timers support. See #716746.



Modified: trunk/kfreebsd-9/debian/changelog
===================================================================
--- trunk/kfreebsd-9/debian/changelog	2013-07-19 13:36:28 UTC (rev 4767)
+++ trunk/kfreebsd-9/debian/changelog	2013-07-19 16:59:05 UTC (rev 4768)
@@ -4,7 +4,12 @@
   * Bump B-D on freebsd-buildutils to 10~svn251967-4.
 
   [ Petr Salinger ]
+  * Build by gcc-4.8,
+    disable unnecessary 901_disable_optimization_2.diff
   * Add 111_ldd_address.diff. Closes: #696556.
+  * Add backport of CPU-timers support. See #716746.
+    - add 000_zombie.diff
+    - add 000_clock_getcpuclockid2.diff
 
  -- Robert Millan <rmh at debian.org>  Sun, 07 Jul 2013 13:56:18 +0200
 

Added: trunk/kfreebsd-9/debian/patches/000_zombie.diff
===================================================================
--- trunk/kfreebsd-9/debian/patches/000_zombie.diff	                        (rev 0)
+++ trunk/kfreebsd-9/debian/patches/000_zombie.diff	2013-07-19 16:59:05 UTC (rev 4768)
@@ -0,0 +1,200 @@
+apply patch from STABLE-9 branch
+enhances clock_getcpuclockid2 patch
+
+------------------------------------------------------------------------
+r243962 | kib | 2012-12-07 02:13:07 +0100 (Fri, 07 Dec 2012) | 11 lines
+
+MFC r243142:
+In pget(9), if PGET_NOTWEXIT flag is not specified, also search the
+zombie list for the pid. This allows several kern.proc sysctls to
+report useful information for zombies.
+
+Hold the allproc_lock around all searches instead of relocking it.
+Remove private pfind_locked() from the new nfs client code.
+
+MFC r243528 (by pjd):
+Look for zombie process only if we were given process id.
+
+--- a/sys/fs/nfsclient/nfs_clport.c	(revision 243961)
++++ b/sys/fs/nfsclient/nfs_clport.c	(revision 243962)
+@@ -1150,31 +1150,6 @@
+ }
+ 
+ /*
+- * Locate a process by number; return only "live" processes -- i.e., neither
+- * zombies nor newly born but incompletely initialized processes.  By not
+- * returning processes in the PRS_NEW state, we allow callers to avoid
+- * testing for that condition to avoid dereferencing p_ucred, et al.
+- * Identical to pfind() in kern_proc.c, except it assume the list is
+- * already locked.
+- */
+-static struct proc *
+-pfind_locked(pid_t pid)
+-{
+-	struct proc *p;
+-
+-	LIST_FOREACH(p, PIDHASH(pid), p_hash)
+-		if (p->p_pid == pid) {
+-			PROC_LOCK(p);
+-			if (p->p_state == PRS_NEW) {
+-				PROC_UNLOCK(p);
+-				p = NULL;
+-			}
+-			break;
+-		}
+-	return (p);
+-}
+-
+-/*
+  * Check to see if the process for this owner exists. Return 1 if it doesn't
+  * and 0 otherwise.
+  */
+
+--- a/sys/sys/proc.h	(revision 243961)
++++ b/sys/sys/proc.h	(revision 243962)
+@@ -835,6 +835,7 @@
+ extern struct uma_zone *proc_zone;
+ 
+ struct	proc *pfind(pid_t);		/* Find process by id. */
++struct	proc *pfind_locked(pid_t pid);
+ struct	pgrp *pgfind(pid_t);		/* Find process group by id. */
+ struct	proc *zpfind(pid_t);		/* Find zombie process by id. */
+ 
+--- a/sys/kern/kern_proc.c	(revision 243961)
++++ b/sys/kern/kern_proc.c	(revision 243962)
+@@ -137,6 +137,7 @@
+ static int proc_init(void *mem, int size, int flags);
+ static void proc_fini(void *mem, int size);
+ static void pargs_free(struct pargs *pa);
++static struct proc *zpfind_locked(pid_t pid);
+ 
+ /*
+  * Other process lists
+@@ -284,20 +285,13 @@
+ 	return (1);
+ }
+ 
+-/*
+- * Locate a process by number; return only "live" processes -- i.e., neither
+- * zombies nor newly born but incompletely initialized processes.  By not
+- * returning processes in the PRS_NEW state, we allow callers to avoid
+- * testing for that condition to avoid dereferencing p_ucred, et al.
+- */
+ struct proc *
+-pfind(pid)
+-	register pid_t pid;
++pfind_locked(pid_t pid)
+ {
+-	register struct proc *p;
++	struct proc *p;
+ 
+-	sx_slock(&allproc_lock);
+-	LIST_FOREACH(p, PIDHASH(pid), p_hash)
++	sx_assert(&allproc_lock, SX_LOCKED);
++	LIST_FOREACH(p, PIDHASH(pid), p_hash) {
+ 		if (p->p_pid == pid) {
+ 			PROC_LOCK(p);
+ 			if (p->p_state == PRS_NEW) {
+@@ -306,17 +300,34 @@
+ 			}
+ 			break;
+ 		}
++	}
++	return (p);
++}
++
++/*
++ * Locate a process by number; return only "live" processes -- i.e., neither
++ * zombies nor newly born but incompletely initialized processes.  By not
++ * returning processes in the PRS_NEW state, we allow callers to avoid
++ * testing for that condition to avoid dereferencing p_ucred, et al.
++ */
++struct proc *
++pfind(pid_t pid)
++{
++	struct proc *p;
++
++	sx_slock(&allproc_lock);
++	p = pfind_locked(pid);
+ 	sx_sunlock(&allproc_lock);
+ 	return (p);
+ }
+ 
+ static struct proc *
+-pfind_tid(pid_t tid)
++pfind_tid_locked(pid_t tid)
+ {
+ 	struct proc *p;
+ 	struct thread *td;
+ 
+-	sx_slock(&allproc_lock);
++	sx_assert(&allproc_lock, SX_LOCKED);
+ 	FOREACH_PROC_IN_SYSTEM(p) {
+ 		PROC_LOCK(p);
+ 		if (p->p_state == PRS_NEW) {
+@@ -330,7 +341,6 @@
+ 		PROC_UNLOCK(p);
+ 	}
+ found:
+-	sx_sunlock(&allproc_lock);
+ 	return (p);
+ }
+ 
+@@ -364,12 +374,17 @@
+ 	struct proc *p;
+ 	int error;
+ 
+-	if (pid <= PID_MAX)
+-		p = pfind(pid);
+-	else if ((flags & PGET_NOTID) == 0)
+-		p = pfind_tid(pid);
+-	else
++	sx_slock(&allproc_lock);
++	if (pid <= PID_MAX) {
++		p = pfind_locked(pid);
++		if (p == NULL && (flags & PGET_NOTWEXIT) == 0)
++			p = zpfind_locked(pid);
++	} else if ((flags & PGET_NOTID) == 0) {
++		p = pfind_tid_locked(pid);
++	} else {
+ 		p = NULL;
++	}
++	sx_sunlock(&allproc_lock);
+ 	if (p == NULL)
+ 		return (ESRCH);
+ 	if ((flags & PGET_CANSEE) != 0) {
+@@ -1046,6 +1061,21 @@
+ 	free(ps, M_SUBPROC);
+ }
+ 
++static struct proc *
++zpfind_locked(pid_t pid)
++{
++	struct proc *p;
++
++	sx_assert(&allproc_lock, SX_LOCKED);
++	LIST_FOREACH(p, &zombproc, p_list) {
++		if (p->p_pid == pid) {
++			PROC_LOCK(p);
++			break;
++		}
++	}
++	return (p);
++}
++
+ /*
+  * Locate a zombie process by number
+  */
+@@ -1055,11 +1085,7 @@
+ 	struct proc *p;
+ 
+ 	sx_slock(&allproc_lock);
+-	LIST_FOREACH(p, &zombproc, p_list)
+-		if (p->p_pid == pid) {
+-			PROC_LOCK(p);
+-			break;
+-		}
++	p = zpfind_locked(pid);
+ 	sx_sunlock(&allproc_lock);
+ 	return (p);
+ }

Modified: trunk/kfreebsd-9/debian/patches/series
===================================================================
--- trunk/kfreebsd-9/debian/patches/series	2013-07-19 13:36:28 UTC (rev 4767)
+++ trunk/kfreebsd-9/debian/patches/series	2013-07-19 16:59:05 UTC (rev 4768)
@@ -2,6 +2,9 @@
 SA-13_05.nfsserver.patch
 SA-13_06.mmap.patch
 
+000_zombie.diff
+000_clock_getcpuclockid2.diff
+
 # Other patches that might or might not be mergeable
 disable_ctf.diff
 001_misc.diff
@@ -19,7 +22,7 @@
 111_ldd_load_address.diff
 
 # Patches that are likely to be Debian-specific
-901_disable_optimization_2.diff
+#901_disable_optimization_2.diff
 902_version.diff
 904_dev_full.diff
 906_grow_sysv_ipc_limits.diff

Modified: trunk/kfreebsd-9/debian/rules
===================================================================
--- trunk/kfreebsd-9/debian/rules	2013-07-19 13:36:28 UTC (rev 4767)
+++ trunk/kfreebsd-9/debian/rules	2013-07-19 16:59:05 UTC (rev 4768)
@@ -22,7 +22,7 @@
 configfile	:= DEBCUSTOM
 abiname		:= 1
 ld_target	:= $(shell ld --help | sed -ne "s/[^ :]*: supported targets: \([^ ]*\) .*/\1/p")
-gcc_version	:= 4.6
+gcc_version	:= 4.8
 
 ifeq ($(cpu), mipsel)
 kfreebsd_cpu	:= mips




More information about the Glibc-bsd-commits mailing list