Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2008 16:08:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/kern kern_sysctl.c
Message-ID:  <200812191608.mBJG8xdS028397@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
kib         2008-12-19 16:08:40 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7_1)
    sys/kern             kern_sysctl.c 
  Log:
  SVN rev 186328 on 2008-12-19 16:08:40Z by kib
  
  MFC r185983:
  The userland_sysctl() function retries sysctl_root() until returned
  error is not EAGAIN. Several sysctls that inspect another process use
  p_candebug() for checking access right for the curproc. p_candebug()
  returns EAGAIN for some reasons, in particular, for the process doing
  exec() now. If execing process tries to lock Giant, we get a livelock,
  because sysctl handlers are covered by Giant, and often do not sleep.
  
  Break the livelock by dropping Giant and allowing other threads to
  execute in the EAGAIN loop.
  
  This commit does not merge the following change, as was discussed with jhb:
  [Also, do not return EAGAIN from p_candebug() when process is executing,
  use more appropriate EBUSY error.]
  
  MFC r185987:
  Uio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this
  around the call.
  
  Approved by:    re (kensmith)
  
  Revision   Changes    Path
  1.177.6.2  +6 -2      src/sys/kern/kern_sysctl.c



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