1. 05 Sep, 2009 1 commit
  2. 31 Jul, 2009 1 commit
    • Andrew Morton's avatar
      build fix · 9e0b8104
      Andrew Morton authored
      Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9e0b8104
  3. 24 Aug, 2009 2 commits
    • Balbir Singh's avatar
      Implement reclaim from groups over their soft limit · 30147beb
      Balbir Singh authored
      Permit reclaim from memory cgroups on contention (via the direct reclaim
      path).
      
      memory cgroup soft limit reclaim finds the group that exceeds its soft
      limit by the largest number of pages and reclaims pages from it and then
      reinserts the cgroup into its correct place in the rbtree.
      
      Add additional checks to mem_cgroup_hierarchical_reclaim() to detect long
      loops in case all swap is turned off.  The code has been refactored and
      the loop check (loop < 2) has been enhanced for soft limits.  For soft
      limits, we try to do more targetted reclaim.  Instead of bailing out after
      two loops, the routine now reclaims memory proportional to the size by
      which the soft limit is exceeded.  The proportion has been empirically
      determined.
      Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      30147beb
    • Balbir Singh's avatar
      Refactor mem_cgroup_hierarchical_reclaim() · c4ac8782
      Balbir Singh authored
      Refactor the arguments passed to mem_cgroup_hierarchical_reclaim() into
      flags, so that new parameters don't have to be passed as we make the
      reclaim routine more flexible
      Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      c4ac8782
  4. 04 Aug, 2009 1 commit
  5. 21 Jul, 2009 3 commits
    • Balbir Singh's avatar
      Organize cgroups over soft limit in a RB-Tree · 6a5bd100
      Balbir Singh authored
      Introduce an RB-Tree for storing memory cgroups that are over their soft
      limit.  The overall goal is to
      
      1. Add a memory cgroup to the RB-Tree when the soft limit is exceeded.
         We are careful about updates, updates take place only after a particular
         time interval has passed
      2. We remove the node from the RB-Tree when the usage goes below the soft
         limit
      
      The next set of patches will exploit the RB-Tree to get the group that is
      over its soft limit by the largest amount and reclaim from it, when we
      face memory contention.
      Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6a5bd100
    • Balbir Singh's avatar
      Add an interface to allow get/set of soft limits. Soft limits for memory · 71583c95
      Balbir Singh authored
      plus swap controller (memsw) is currently not supported.  Resource
      counters have been enhanced to support soft limits and new type
      RES_SOFT_LIMIT has been added.  Unlike hard limits, soft limits can be
      directly set and do not need any reclaim or checks before setting them to
      a newer value.
      
      Kamezawa-San raised a question as to whether soft limit should belong to
      res_counter.  Since all resources understand the basic concepts of hard
      and soft limits, it is justified to add soft limits here.  Soft limits are
      a generic resource usage feature, even file system quotas support soft
      limits.
      Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      71583c95
    • Balbir Singh's avatar
      Soft limits is a new feature for the memory resource controller, something · e0b231f8
      Balbir Singh authored
      similar has existed in the group scheduler in the form of shares.  The CPU
      controllers interpretation of shares is very different though.  
      
      Soft limits are the most useful feature to have for environments where the
      administrator wants to overcommit the system, such that only on memory
      contention do the limits become active.  The current soft limits
      implementation provides a soft_limit_in_bytes interface for the memory
      controller and not for memory+swap controller.  The implementation
      maintains an RB-Tree of groups that exceed their soft limit and starts
      reclaiming from the group that exceeds this limit by the maximum amount.
      
      This patch:
      
      Add documentation for soft limits
      Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      e0b231f8
  6. 26 Jun, 2009 2 commits
    • Andrew Morton's avatar
      ERROR: code indent should use tabs where possible · 6f4830de
      Andrew Morton authored
      #22: FILE: mm/memcontrol.c:1138:
      + ^I * We access a page_cgroup asynchronously without lock_page_cgroup().$
      
      ERROR: code indent should use tabs where possible
      #23: FILE: mm/memcontrol.c:1139:
      + ^I * Especially when a page_cgroup is taken from a page, pc->mem_cgroup$
      
      ERROR: code indent should use tabs where possible
      #24: FILE: mm/memcontrol.c:1140:
      + ^I * is accessed after testing USED bit. To make pc->mem_cgroup visible$
      
      ERROR: code indent should use tabs where possible
      #25: FILE: mm/memcontrol.c:1141:
      + ^I * before USED bit, we need memory barrier here.$
      
      ERROR: code indent should use tabs where possible
      #26: FILE: mm/memcontrol.c:1142:
      + ^I * See mem_cgroup_add_lru_list(), etc.$
      
      ERROR: code indent should use tabs where possible
      #27: FILE: mm/memcontrol.c:1143:
      + ^I */$
      
      total: 6 errors, 0 warnings, 13 lines checked
      
      ./patches/memcg-add-comments-explaining-memory-barriers.patch has style problems, please review.  If any of these errors
      are false positives report them to the maintainer, see
      CHECKPATCH in MAINTAINERS.
      
      Please run checkpatch prior to sending patches
      
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6f4830de
    • KAMEZAWA Hiroyuki's avatar
      Add comments for the reason of smp_wmb() in mem_cgroup_commit_charge(). · 6200a558
      KAMEZAWA Hiroyuki authored
      Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
      Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
      Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6200a558
  7. 29 Jun, 2009 1 commit
  8. 23 Jun, 2009 1 commit
  9. 24 Aug, 2009 1 commit
  10. 20 Aug, 2009 2 commits
  11. 24 Aug, 2009 3 commits
  12. 20 Aug, 2009 5 commits
    • Ben Blum's avatar
      Changes css_set freeing mechanism to be under RCU · 438b7e24
      Ben Blum authored
      This is a prepatch for making the procs file writable. In order to free the
      old css_sets for each task to be moved as they're being moved, the freeing
      mechanism must be RCU-protected, or else we would have to have a call to
      synchronize_rcu() for each task before freeing its old css_set.
      Signed-off-by: default avatarBen Blum <bblum@google.com>
      Signed-off-by: default avatarPaul Menage <menage@google.com>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      438b7e24
    • Ben Blum's avatar
      Separates all pidlist allocation requests to a separate function that · 314aaff3
      Ben Blum authored
      judges based on the requested size whether or not the array needs to be
      vmalloced or can be gotten via kmalloc, and similar for kfree/vfree.
      Signed-off-by: default avatarBen Blum <bblum@google.com>
      Signed-off-by: default avatarPaul Menage <menage@google.com>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      314aaff3
    • Ben Blum's avatar
      Previously there was the problem in which two processes from different pid · cc0f79f0
      Ben Blum authored
      namespaces reading the tasks or procs file could result in one process
      seeing results from the other's namespace.  Rather than one pidlist for
      each file in a cgroup, we now keep a list of pidlists keyed by namespace
      and file type (tasks versus procs) in which entries are placed on demand. 
      Each pidlist has its own lock, and that the pidlists themselves are passed
      around in the seq_file's private pointer means we don't have to touch the
      cgroup or its master list except when creating and destroying entries.
      Signed-off-by: default avatarBen Blum <bblum@google.com>
      Signed-off-by: default avatarPaul Menage <menage@google.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      cc0f79f0
    • Ben Blum's avatar
      struct cgroup used to have a bunch of fields for keeping track of the · 575e8c8d
      Ben Blum authored
      pidlist for the tasks file.  Those are now separated into a new struct
      cgroup_pidlist, of which two are had, one for procs and one for tasks. 
      The way the seq_file operations are set up is changed so that just the
      pidlist struct gets passed around as the private data.
      
      Interface example: Suppose a multithreaded process has pid 1000 and other
      threads with ids 1001, 1002, 1003:
      $ cat tasks
      1000
      1001
      1002
      1003
      $ cat cgroup.procs
      1000
      $
      Signed-off-by: default avatarBen Blum <bblum@google.com>
      Signed-off-by: default avatarPaul Menage <menage@google.com>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      575e8c8d
    • Paul Menage's avatar
      The following series adds a "cgroup.procs" file to each cgroup that · cbf508cb
      Paul Menage authored
      reports unique tgids rather than pids, and allows all threads in a
      threadgroup to be atomically moved to a new cgroup.
      
      The subsystem "attach" interface is modified to support attaching whole
      threadgroups at a time, which could introduce potential problems if any
      subsystem were to need to access the old cgroup of every thread being
      moved.  The attach interface may need to be revised if this becomes the
      case.
      
      Also added is functionality for read/write locking all CLONE_THREAD
      fork()ing within a threadgroup, by means of an rwsem that lives in the
      sighand_struct, for per-threadgroup-ness and also for sharing a cacheline
      with the sighand's atomic count.  This scheme should introduce no extra
      overhead in the fork path when there's no contention.
      
      The final patch reveals potential for a race when forking before a
      subsystem's attach function is called - one potential solution in case any
      subsystem has this problem is to hang on to the group's fork mutex through
      the attach() calls, though no subsystem yet demonstrates need for an
      extended critical section.
      
      
      
      This patch:
      
      Revert
      
      commit 096b7fe0
      Author:     Li Zefan <lizf@cn.fujitsu.com>
      AuthorDate: Wed Jul 29 15:04:04 2009 -0700
      Commit:     Linus Torvalds <torvalds@linux-foundation.org>
      CommitDate: Wed Jul 29 19:10:35 2009 -0700
      
          cgroups: fix pid namespace bug
      
      
      This is in preparation for some clashing cgroups changes that subsume the
      original commit's functionaliy.
      
      The original commit fixed a pid namespace bug which Ben Blum fixed
      independently (in the same way, but with different code) as part of a
      series of patches.  I played around with trying to reconcile Ben's patch
      series with Li's patch, but concluded that it was simpler to just revert
      Li's, given that Ben's patch series contained essentially the same fix.
      Signed-off-by: default avatarPaul Menage <menage@google.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      cbf508cb
  13. 30 Jul, 2009 4 commits
  14. 24 Jul, 2009 1 commit
  15. 13 Sep, 2009 1 commit
  16. 09 Sep, 2009 2 commits
  17. 18 Aug, 2009 1 commit
  18. 14 Aug, 2009 1 commit
  19. 04 Aug, 2009 1 commit
  20. 31 Jul, 2009 3 commits
  21. 24 Aug, 2009 1 commit
    • Zhaolei's avatar
      There are many similar code in kernel for one object: convert time between · bf0a06dd
      Zhaolei authored
      calendar time and broken-down time.
      
      Here is some source I found:
      fs/ncpfs/dir.c
      fs/smbfs/proc.c
      fs/fat/misc.c
      fs/udf/udftime.c
      fs/cifs/netmisc.c
      net/netfilter/xt_time.c
      drivers/scsi/ips.c
      drivers/input/misc/hp_sdc_rtc.c
      drivers/rtc/rtc-lib.c
      arch/ia64/hp/sim/boot/fw-emu.c
      arch/m68k/mac/misc.c
      arch/powerpc/kernel/time.c
      arch/parisc/include/asm/rtc.h
      ...
      
      We can make a common function for this type of conversoion, At least we
      can get following benefit:
      
      1: Make kernel simple and unify
      2: Easy to fix bug in converting code
      3: Reduce clone of code in future
         For example, I'm trying to make ftrace display walltime,
         this patch will make me easy.
      
      This code is based on code from glibc-2.6
      Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      bf0a06dd
  22. 27 Aug, 2009 2 commits