1. 10 7月, 2013 6 次提交
  2. 01 5月, 2013 6 次提交
  3. 03 4月, 2013 1 次提交
  4. 09 3月, 2013 1 次提交
  5. 05 1月, 2013 7 次提交
  6. 07 9月, 2012 1 次提交
  7. 31 3月, 2011 1 次提交
  8. 24 3月, 2011 1 次提交
  9. 25 5月, 2010 1 次提交
  10. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  11. 16 12月, 2009 1 次提交
  12. 04 12月, 2009 1 次提交
  13. 14 1月, 2009 1 次提交
  14. 07 6月, 2008 1 次提交
  15. 29 4月, 2008 9 次提交
    • Z
      ipc: add definitions of USHORT_MAX and others · 44f564a4
      Zhang, Yanmin 提交于
      Add definitions of USHORT_MAX and others into kernel.  ipc uses it and slub
      implementation might also use it.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NZhang Yanmin <yanmin.zhang@intel.com>
      Reviewed-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Cc: "Pierre Peiffer" <peifferp@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      44f564a4
    • P
      IPC: consolidate all xxxctl_down() functions · a5f75e7f
      Pierre Peiffer 提交于
      semctl_down(), msgctl_down() and shmctl_down() are used to handle the same set
      of commands for each kind of IPC.  They all start to do the same job (they
      retrieve the ipc and do some permission checks) before handling the commands
      on their own.
      
      This patch proposes to consolidate this by moving these same pieces of code
      into one common function called ipcctl_pre_down().
      
      It simplifies a little these xxxctl_down() functions and increases a little
      the maintainability.
      Signed-off-by: NPierre Peiffer <pierre.peiffer@bull.net>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a5f75e7f
    • P
      IPC: introduce ipc_update_perm() · 8f4a3809
      Pierre Peiffer 提交于
      The IPC_SET command performs the same permission setting for all IPCs.  This
      patch introduces a common ipc_update_perm() function to update these
      permissions and makes use of it for all IPCs.
      Signed-off-by: NPierre Peiffer <pierre.peiffer@bull.net>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8f4a3809
    • P
      IPC: get rid of the use *_setbuf structure. · 016d7132
      Pierre Peiffer 提交于
      All IPCs make use of an intermetiate *_setbuf structure to handle the IPC_SET
      command.  This is not really needed and, moreover, it complicates a little bit
      the code.
      
      This patch gets rid of the use of it and uses directly the semid64_ds/
      msgid64_ds/shmid64_ds structure.
      
      In addition of removing one struture declaration, it also simplifies and
      improves a little bit the common 64-bits path.
      Signed-off-by: NPierre Peiffer <pierre.peiffer@bull.net>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      016d7132
    • P
      IPC/message queues: introduce msgctl_down · a0d092fc
      Pierre Peiffer 提交于
      Currently, sys_msgctl is not easy to read.
      
      This patch tries to improve that by introducing the msgctl_down function to
      handle all commands requiring the rwmutex to be taken in write mode (ie
      IPC_SET and IPC_RMID for now).  It is the equivalent function of semctl_down
      for message queues.
      
      This greatly changes the readability of sys_msgctl and also harmonizes the way
      these commands are handled among all IPCs.
      Signed-off-by: NPierre Peiffer <pierre.peiffer@bull.net>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a0d092fc
    • N
      ipc: recompute msgmni on memory add / remove · b6b337ad
      Nadia Derbey 提交于
      Introduce the registration of a callback routine that recomputes msg_ctlmni
      upon memory add / remove.
      
      A single notifier block is registered in the hotplug memory chain for all the
      ipc namespaces.
      
      Since the ipc namespaces are not linked together, they have their own
      notification chain: one notifier_block is defined per ipc namespace.
      
      Each time an ipc namespace is created (removed) it registers (unregisters) its
      notifier block in (from) the ipcns chain.  The callback routine registered in
      the memory chain invokes the ipcns notifier chain with the IPCNS_LOWMEM event.
       Each callback routine registered in the ipcns namespace, in turn, recomputes
      msgmni for the owning namespace.
      Signed-off-by: NNadia Derbey <Nadia.Derbey@bull.net>
      Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: Mingming Cao <cmm@us.ibm.com>
      Cc: Pierre Peiffer <pierre.peiffer@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b6b337ad
    • N
      ipc: scale msgmni to the number of ipc namespaces · 4d89dc6a
      Nadia Derbey 提交于
      Since all the namespaces see the same amount of memory (the total one) this
      patch introduces a new variable that counts the ipc namespaces and divides
      msg_ctlmni by this counter.
      Signed-off-by: NNadia Derbey <Nadia.Derbey@bull.net>
      Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: Mingming Cao <cmm@us.ibm.com>
      Cc: Pierre Peiffer <pierre.peiffer@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4d89dc6a
    • N
      ipc: scale msgmni to the amount of lowmem · f7bf3df8
      Nadia Derbey 提交于
      On large systems we'd like to allow a larger number of message queues.  In
      some cases up to 32K.  However simply setting MSGMNI to a larger value may
      cause problems for smaller systems.
      
      The first patch of this series introduces a default maximum number of message
      queue ids that scales with the amount of lowmem.
      
      Since msgmni is per namespace and there is no amount of memory dedicated to
      each namespace so far, the second patch of this series scales msgmni to the
      number of ipc namespaces too.
      
      Since msgmni depends on the amount of memory, it becomes necessary to
      recompute it upon memory add/remove.  In the 4th patch, memory hotplug
      management is added: a notifier block is registered into the memory hotplug
      notifier chain for the ipc subsystem.  Since the ipc namespaces are not linked
      together, they have their own notification chain: one notifier_block is
      defined per ipc namespace.  Each time an ipc namespace is created (removed) it
      registers (unregisters) its notifier block in (from) the ipcns chain.  The
      callback routine registered in the memory chain invokes the ipcns notifier
      chain with the IPCNS_MEMCHANGE event.  Each callback routine registered in the
      ipcns namespace, in turn, recomputes msgmni for the owning namespace.
      
      The 5th patch makes it possible to keep the memory hotplug notifier chain's
      lock for a lesser amount of time: instead of directly notifying the ipcns
      notifier chain upon memory add/remove, a work item is added to the global
      workqueue.  When activated, this work item is the one who notifies the ipcns
      notifier chain.
      
      Since msgmni depends on the number of ipc namespaces, it becomes necessary to
      recompute it upon ipc namespace creation / removal.  The 6th patch uses the
      ipc namespace notifier chain for that purpose: that chain is notified each
      time an ipc namespace is created or removed.  This makes it possible to
      recompute msgmni for all the namespaces each time one of them is created or
      removed.
      
      When msgmni is explicitely set from userspace, we should avoid recomputing it
      upon memory add/remove or ipcns creation/removal.  This is what the 7th patch
      does: it simply unregisters the ipcns callback routine as soon as msgmni has
      been changed from procfs or sysctl().
      
      Even if msgmni is set by hand, it should be possible to make it back
      automatically recomputed upon memory add/remove or ipcns creation/removal.
      This what is achieved in patch 8: if set to a negative value, msgmni is added
      back to the ipcns notifier chain, making it automatically recomputed again.
      
      This patch:
      
      Compute msg_ctlmni to make it scale with the amount of lowmem.  msg_ctlmni is
      now set to make the message queues occupy 1/32 of the available lowmem.
      
      Some cleaning has also been done for the MSGPOOL constant: the msgctl man page
      says it's not used, but it also defines it as a size in bytes (the code
      expresses it in Kbytes).
      Signed-off-by: NNadia Derbey <Nadia.Derbey@bull.net>
      Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: Mingming Cao <cmm@us.ibm.com>
      Cc: Pierre Peiffer <pierre.peiffer@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f7bf3df8
    • P
      IPC: use ipc_buildid() directly from ipc_addid() · 48dea404
      Pierre Peiffer 提交于
      By continuing to consolidate a little the IPC code, each id can be built
      directly in ipc_addid() instead of having it built from each callers of
      ipc_addid()
      
      And I also remove shm_addid() in order to have, as much as possible, the
      same code for shm/sem/msg.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NPierre Peiffer <pierre.peiffer@bull.net>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      48dea404
  16. 09 2月, 2008 1 次提交