1. 09 5月, 2007 9 次提交
  2. 08 5月, 2007 5 次提交
    • C
      slab allocators: Remove SLAB_DEBUG_INITIAL flag · 50953fe9
      Christoph Lameter 提交于
      I have never seen a use of SLAB_DEBUG_INITIAL.  It is only supported by
      SLAB.
      
      I think its purpose was to have a callback after an object has been freed
      to verify that the state is the constructor state again?  The callback is
      performed before each freeing of an object.
      
      I would think that it is much easier to check the object state manually
      before the free.  That also places the check near the code object
      manipulation of the object.
      
      Also the SLAB_DEBUG_INITIAL callback is only performed if the kernel was
      compiled with SLAB debugging on.  If there would be code in a constructor
      handling SLAB_DEBUG_INITIAL then it would have to be conditional on
      SLAB_DEBUG otherwise it would just be dead code.  But there is no such code
      in the kernel.  I think SLUB_DEBUG_INITIAL is too problematic to make real
      use of, difficult to understand and there are easier ways to accomplish the
      same effect (i.e.  add debug code before kfree).
      
      There is a related flag SLAB_CTOR_VERIFY that is frequently checked to be
      clear in fs inode caches.  Remove the pointless checks (they would even be
      pointless without removeal of SLAB_DEBUG_INITIAL) from the fs constructors.
      
      This is the last slab flag that SLUB did not support.  Remove the check for
      unimplemented flags from SLUB.
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      50953fe9
    • D
      smaps: add clear_refs file to clear reference · b813e931
      David Rientjes 提交于
      Adds /proc/pid/clear_refs.  When any non-zero number is written to this file,
      pte_mkold() and ClearPageReferenced() is called for each pte and its
      corresponding page, respectively, in that task's VMAs.  This file is only
      writable by the user who owns the task.
      
      It is now possible to measure _approximately_ how much memory a task is using
      by clearing the reference bits with
      
      	echo 1 > /proc/pid/clear_refs
      
      and checking the reference count for each VMA from the /proc/pid/smaps output
      at a measured time interval.  For example, to observe the approximate change
      in memory footprint for a task, write a script that clears the references
      (echo 1 > /proc/pid/clear_refs), sleeps, and then greps for Pgs_Referenced and
      extracts the size in kB.  Add the sizes for each VMA together for the total
      referenced footprint.  Moments later, repeat the process and observe the
      difference.
      
      For example, using an efficient Mozilla:
      
      	accumulated time		referenced memory
      	----------------		-----------------
      		 0 s				 408 kB
      		 1 s				 408 kB
      		 2 s				 556 kB
      		 3 s				1028 kB
      		 4 s				 872 kB
      		 5 s				1956 kB
      		 6 s				 416 kB
      		 7 s				1560 kB
      		 8 s				2336 kB
      		 9 s				1044 kB
      		10 s				 416 kB
      
      This is a valuable tool to get an approximate measurement of the memory
      footprint for a task.
      
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Christoph Lameter <clameter@sgi.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      [akpm@linux-foundation.org: build fixes]
      [mpm@selenic.com: rename for_each_pmd]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b813e931
    • D
      smaps: add pages referenced count to smaps · f79f177c
      David Rientjes 提交于
      Adds an additional unsigned long field to struct mem_size_stats called
      'referenced'.  For each pte walked in the smaps code, this field is
      incremented by PAGE_SIZE if it has pte-reference bits.
      
      An additional line was added to the /proc/pid/smaps output for each VMA to
      indicate how many pages within it are currently marked as referenced or
      accessed.
      
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Christoph Lameter <clameter@sgi.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f79f177c
    • D
      smaps: extract pmd walker from smaps code · 826fad1b
      David Rientjes 提交于
      Extracts the pmd walker from smaps-specific code in fs/proc/task_mmu.c.
      
      The new struct pmd_walker includes the struct vm_area_struct of the memory to
      walk over.  Iteration begins at the vma->vm_start and completes at
      vma->vm_end.  A pointer to another data structure may be stored in the private
      field such as struct mem_size_stats, which acts as the smaps accumulator.  For
      each pmd in the VMA, the action function is called with a pointer to its
      struct vm_area_struct, a pointer to the pmd_t, its start and end addresses,
      and the private field.
      
      The interface for walking pmd's in a VMA for fs/proc/task_mmu.c is now:
      
      	void for_each_pmd(struct vm_area_struct *vma,
      			  void (*action)(struct vm_area_struct *vma,
      					 pmd_t *pmd, unsigned long addr,
      					 unsigned long end,
      					 void *private),
      			  void *private);
      
      Since the pmd walker is now extracted from the smaps code, smaps_one_pmd() is
      invoked for each pmd in the VMA.  Its behavior and efficiency is identical to
      the existing implementation.
      
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Christoph Lameter <clameter@sgi.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      826fad1b
    • A
      mm/slab.c: proper prototypes · ac267728
      Adrian Bunk 提交于
      Add proper prototypes in include/linux/slab.h.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ac267728
  3. 03 5月, 2007 1 次提交
  4. 13 4月, 2007 1 次提交
  5. 03 4月, 2007 1 次提交
  6. 28 3月, 2007 1 次提交
    • M
      [PATCH] Fix kernel build with EMBEDDED & PROC_FS & !PROC_SYSCTL · 5c46010a
      Mika Kukkonen 提交于
      Without attached patch against current -git I get following with
      !PROC_SYSCTL (with EMBEDDED and PROC_FS set):
      
          CC      init/version.o
          LD      init/built-in.o
          LD      vmlinux
        fs/built-in.o: In function `do_proc_sys_lookup':
        proc_sysctl.c:(.text+0x26583): undefined reference to `sysctl_head_next'
        fs/built-in.o: In function `proc_sys_revalidate':
        proc_sysctl.c:(.text+0x265bb): undefined reference to `sysctl_head_finish'
        fs/built-in.o: In function `proc_sys_readdir':
        proc_sysctl.c:(.text+0x26720): undefined reference to `sysctl_head_next'
        proc_sysctl.c:(.text+0x267d8): undefined reference to `sysctl_head_finish'
        proc_sysctl.c:(.text+0x268e7): undefined reference to `sysctl_head_next'
        proc_sysctl.c:(.text+0x26910): undefined reference to `sysctl_head_finish'
        fs/built-in.o: In function `proc_sys_write':
        proc_sysctl.c:(.text+0x2695d): undefined reference to `sysctl_perm'
        proc_sysctl.c:(.text+0x2699c): undefined reference to `sysctl_head_finish'
        fs/built-in.o: In function `proc_sys_read':
        proc_sysctl.c:(.text+0x269e9): undefined reference to `sysctl_perm'
        proc_sysctl.c:(.text+0x26a25): undefined reference to `sysctl_head_finish'
        fs/built-in.o: In function `proc_sys_permission':
        proc_sysctl.c:(.text+0x26ad1): undefined reference to `sysctl_perm'
        proc_sysctl.c:(.text+0x26adb): undefined reference to `sysctl_head_finish'
        fs/built-in.o: In function `proc_sys_lookup':
        proc_sysctl.c:(.text+0x26b39): undefined reference to `sysctl_head_finish'
        make: *** [vmlinux] Virhe 1
      
      All those functions are in fs/proc/proc_sysctl.c, which has no CONFIG_
      #define's in it, so the patch makes the compilation of that file to depend
      on CONFIG_PROC_SYSCTL (the simplest choice).
      Acked-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5c46010a
  7. 15 3月, 2007 1 次提交
  8. 21 2月, 2007 1 次提交
  9. 15 2月, 2007 3 次提交
  10. 13 2月, 2007 4 次提交
  11. 12 2月, 2007 3 次提交
  12. 02 2月, 2007 1 次提交
  13. 27 1月, 2007 1 次提交
    • A
      [PATCH] Fix NULL ->nsproxy dereference in /proc/*/mounts · 863c4702
      Alexey Dobriyan 提交于
      /proc/*/mounstats was fixed, all right, but...
      
      To reproduce:
      
      	while true; do
      		find /proc -type f 2>/dev/null | xargs cat 1>/dev/null 2>/dev/null;
      	done
      
      BUG: unable to handle kernel NULL pointer dereference at virtual address 0000000c
       printing eip:
      c01754df
      *pde = 00000000
      Oops: 0000 [#28]
      Modules linked in: af_packet ohci_hcd e1000 ehci_hcd uhci_hcd usbcore xfs
      CPU:    0
      EIP:    0060:[<c01754df>]    Not tainted VLI
      EFLAGS: 00010286   (2.6.20-rc5 #1)
      EIP is at mounts_open+0x1c/0xac
      eax: 00000000   ebx: d5898ac0   ecx: d1d27b18   edx: d1d27a50
      esi: e6083e10   edi: d3c87f38   ebp: d5898ac0   esp: d3c87ef0
      ds: 007b   es: 007b   ss: 0068
      Process cat (pid: 18071, ti=d3c86000 task=f7d5f070 task.ti=d3c86000)
      Stack: d5898ac0 e6083e10 d3c87f38 c01754c3 c0147c91 c18c52c0 d343f314 d5898ac0
             00008000 d3c87f38 ffffff9c c0147e09 d5898ac0 00000000 00000000 c0147e4b
             00000000 d3c87f38 d343f314 c18c52c0 c015e53e 00001000 08051000 00000101
      Call Trace:
       [<c01754c3>] mounts_open+0x0/0xac
       [<c0147c91>] __dentry_open+0xa1/0x18c
       [<c0147e09>] nameidata_to_filp+0x31/0x3a
       [<c0147e4b>] do_filp_open+0x39/0x40
       [<c015e53e>] seq_read+0x128/0x2aa
       [<c0147e8c>] do_sys_open+0x3a/0x6d
       [<c0147efa>] sys_open+0x1c/0x20
       [<c0102b76>] sysenter_past_esp+0x5f/0x85
       [<c02a0033>] unix_stream_recvmsg+0x3bf/0x4bf
       =======================
      Code: 5d c3 89 d8 e8 06 e0 f9 ff eb bd 0f 0b eb fe 55 57 56 53 89 d5 8b 40 f0 31 d2 e8 02 c1 fa ff 89 c2 85 c0 74 5c 8b 80 48 04 00 00 <8b> 58 0c 85 db 74 02 ff 03 ff 4a 08 0f 94 c0 84 c0 75 74 85 db
      EIP: [<c01754df>] mounts_open+0x1c/0xac SS:ESP 0068:d3c87ef0
      
      A race with do_exit()'s call to exit_namespaces().
      Signed-off-by: NAlexey Dobriyan <adobriyan@openvz.org>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      863c4702
  14. 11 1月, 2007 1 次提交
  15. 12 12月, 2006 1 次提交
    • L
      Make SLES9 "get_kernel_version" work on the kernel binary again · 8993780a
      Linus Torvalds 提交于
      As reported by Andy Whitcroft, at least the SLES9 initrd build process
      depends on getting the kernel version from the kernel binary.  It does
      that by simply trawling the binary and looking for the signature of the
      "linux_banner" string (the string "Linux version " to be exact. Which
      is really broken in itself, but whatever..)
      
      That got broken when the string was changed to allow /proc/version to
      change the UTS release information dynamically, and "get_kernel_version"
      thus returned "%s" (see commit a2ee8649:
      "[PATCH] Fix linux banner utsname information").
      
      This just restores "linux_banner" as a static string, which should fix
      the version finding.  And /proc/version simply uses a different string.
      
      To avoid wasting even that miniscule amount of memory, the early boot
      string should really be marked __initdata, but that just causes the same
      bug in SLES9 to re-appear, since it will then find other occurrences of
      "Linux version " first.
      
      Cc: Andy Whitcroft <apw@shadowen.org>
      Acked-by: NHerbert Poetzl <herbert@13thfloor.at>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Andrew Morton <akpm@osdl.org>
      Cc: Steve Fox <drfickle@us.ibm.com>
      Acked-by: NOlaf Hering <olaf@aepfle.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8993780a
  16. 11 12月, 2006 1 次提交
    • A
      [PATCH] io-accounting: report in procfs · aba76fdb
      Andrew Morton 提交于
      Add a simple /proc/pid/io to show the IO accounting fields.
      
      Maybe this shouldn't be merged in mainline - the preferred reporting channel
      is taskstats.  But given the poor state of our userspace support for
      taskstats, this is useful for developer-testing, at least.  And it improves
      the changes that the procps developers will wire it up into top(1).  Opinions
      are sought.
      
      The patch also wires up the existing IO-accounting fields.
      
      It's a bit racy on 32-bit machines: if process A reads process B's
      /proc/pid/io while process B is updating one of those 64-bit counters, process
      A could see an intermediate result.
      
      Cc: Jay Lan <jlan@sgi.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Chris Sturtivant <csturtiv@sgi.com>
      Cc: Tony Ernst <tee@sgi.com>
      Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
      Cc: David Wright <daw@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      aba76fdb
  17. 09 12月, 2006 5 次提交