git: kernel - Make numerous proc accesses use p->p_token instead of proc_token.

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Feb 13 21:09:02 PST 2011


commit 58c2553a79a1ecfcbfd3ab0cb8e383052af37406
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Feb 13 20:57:32 2011 -0800

    kernel - Make numerous proc accesses use p->p_token instead of proc_token.
    
    * pfind() zpfind() now returns a referenced proc structure, callers must
      release the proc with PRELE().  Callers no longer need to hold proc_token
      for stable access.
    
    * Enhance pgrp, adding pgrp->pg_token and pgrp->pg_refs in addition to
      pgrp->pg_lock.  The lock is used to interlock races between fork() and
      signals while the token and refs are used to control access.
    
    * Add pfindn(), a version of pfind() which does not ref the returned proc.
      Some code still uses it (linux emulation) ---> needs work.
    
    * Add pgref() and pgrel() to mess with the pgrp's pg_refs.  pgrel()
      automatically destroys the pgrp when the last reference goes away.
    
    * Most process group operations now use the per-process token instead of
      proc_token, though pgfind() still needs it temporarily.
    
    * pgfind() now returns a referenced pgrp or NULL.
    
    * Interlock signal handling with p->p_token instead of proc_token.
    
    * Adjust most nice/priority functions to use the per-process token.
    
    * Add protective PHOLD()s in various places in the signal code, the
      ptrace code, and procfs.
    
    * Change funsetown() to take the address of the sigio pointer to match
      fsetown(), add sanity assertions.
    
    * pgrp's in tty sessions are now ref-counted.

Summary of changes:
 sys/dev/drm/drm_drv.c                              |    2 +-
 sys/dev/misc/syscons/scmouse.c                     |   21 ++-
 sys/dev/misc/syscons/syscons.c                     |    6 +-
 sys/emulation/linux/i386/linprocfs/linprocfs.h     |    2 +-
 .../linux/i386/linprocfs/linprocfs_vnops.c         |   36 +++--
 sys/emulation/linux/i386/linux_machdep.c           |    6 +-
 sys/emulation/linux/i386/linux_ptrace.c            |    6 +
 sys/emulation/linux/linux_futex.c                  |    4 +-
 sys/emulation/linux/linux_misc.c                   |    4 +
 sys/emulation/linux/linux_signal.c                 |    1 -
 sys/kern/init_main.c                               |    8 +-
 sys/kern/kern_descrip.c                            |   73 ++++++---
 sys/kern/kern_event.c                              |   11 +-
 sys/kern/kern_exit.c                               |   24 ++-
 sys/kern/kern_fork.c                               |   20 ++-
 sys/kern/kern_ktrace.c                             |    9 +-
 sys/kern/kern_p1003_1b.c                           |   16 ++-
 sys/kern/kern_proc.c                               |  129 ++++++++++++----
 sys/kern/kern_prot.c                               |   42 ++++--
 sys/kern/kern_resource.c                           |  163 ++++++++++++--------
 sys/kern/kern_sig.c                                |   38 ++++-
 sys/kern/subr_log.c                                |    2 +-
 sys/kern/sys_pipe.c                                |    2 +-
 sys/kern/sys_process.c                             |   28 ++++
 sys/kern/tty.c                                     |   30 +++-
 sys/kern/uipc_socket.c                             |    2 +-
 sys/kern/uipc_syscalls.c                           |    3 +-
 sys/net/bpf.c                                      |    2 +-
 sys/net/tap/if_tap.c                               |    4 +-
 sys/net/tun/if_tun.c                               |    2 +-
 sys/platform/pc32/i386/db_trace.c                  |    2 +-
 sys/sys/filedesc.h                                 |    5 +-
 sys/sys/proc.h                                     |   17 ++-
 sys/vfs/procfs/procfs.h                            |    2 -
 sys/vfs/procfs/procfs_ctl.c                        |    4 +-
 sys/vfs/procfs/procfs_subr.c                       |    4 +-
 sys/vfs/procfs/procfs_vnops.c                      |  130 +++++++++++-----
 37 files changed, 607 insertions(+), 253 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/58c2553a79a1ecfcbfd3ab0cb8e383052af37406


-- 
DragonFly BSD source repository





More information about the Commits mailing list