1. 10 1月, 2009 3 次提交
  2. 09 1月, 2009 27 次提交
  3. 08 1月, 2009 8 次提交
    • D
      CRED: Fix commit_creds() on a process that has no mm · b9456371
      David Howells 提交于
      Fix commit_creds()'s handling of a process that has no mm (such as one that is
      calling or has called daemonize()).  commit_creds() should check to see if
      task->mm is not NULL before calling set_dumpable() on it.
      Reported-by: NJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      b9456371
    • P
      NOMMU: Make mmap allocation page trimming behaviour configurable. · dd8632a1
      Paul Mundt 提交于
      NOMMU mmap allocates a piece of memory for an mmap that's rounded up in size to
      the nearest power-of-2 number of pages.  Currently it then discards the excess
      pages back to the page allocator, making that memory available for use by other
      things.  This can, however, cause greater amount of fragmentation.
      
      To counter this, a sysctl is added in order to fine-tune the trimming
      behaviour.  The default behaviour remains to trim pages aggressively, while
      this can either be disabled completely or set to a higher page-granular
      watermark in order to have finer-grained control.
      
      vm region vm_top bits taken from an earlier patch by David Howells.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Tested-by: NMike Frysinger <vapier.adi@gmail.com>
      dd8632a1
    • D
      NOMMU: Make VMAs per MM as for MMU-mode linux · 8feae131
      David Howells 提交于
      Make VMAs per mm_struct as for MMU-mode linux.  This solves two problems:
      
       (1) In SYSV SHM where nattch for a segment does not reflect the number of
           shmat's (and forks) done.
      
       (2) In mmap() where the VMA's vm_mm is set to point to the parent mm by an
           exec'ing process when VM_EXECUTABLE is specified, regardless of the fact
           that a VMA might be shared and already have its vm_mm assigned to another
           process or a dead process.
      
      A new struct (vm_region) is introduced to track a mapped region and to remember
      the circumstances under which it may be shared and the vm_list_struct structure
      is discarded as it's no longer required.
      
      This patch makes the following additional changes:
      
       (1) Regions are now allocated with alloc_pages() rather than kmalloc() and
           with no recourse to __GFP_COMP, so the pages are not composite.  Instead,
           each page has a reference on it held by the region.  Anything else that is
           interested in such a page will have to get a reference on it to retain it.
           When the pages are released due to unmapping, each page is passed to
           put_page() and will be freed when the page usage count reaches zero.
      
       (2) Excess pages are trimmed after an allocation as the allocation must be
           made as a power-of-2 quantity of pages.
      
       (3) VMAs are added to the parent MM's R/B tree and mmap lists.  As an MM may
           end up with overlapping VMAs within the tree, the VMA struct address is
           appended to the sort key.
      
       (4) Non-anonymous VMAs are now added to the backing inode's prio list.
      
       (5) Holes may be punched in anonymous VMAs with munmap(), releasing parts of
           the backing region.  The VMA and region structs will be split if
           necessary.
      
       (6) sys_shmdt() only releases one attachment to a SYSV IPC shared memory
           segment instead of all the attachments at that addresss.  Multiple
           shmat()'s return the same address under NOMMU-mode instead of different
           virtual addresses as under MMU-mode.
      
       (7) Core dumping for ELF-FDPIC requires fewer exceptions for NOMMU-mode.
      
       (8) /proc/maps is now the global list of mapped regions, and may list bits
           that aren't actually mapped anywhere.
      
       (9) /proc/meminfo gains a line (tagged "MmapCopy") that indicates the amount
           of RAM currently allocated by mmap to hold mappable regions that can't be
           mapped directly.  These are copies of the backing device or file if not
           anonymous.
      
      These changes make NOMMU mode more similar to MMU mode.  The downside is that
      NOMMU mode requires some extra memory to track things over NOMMU without this
      patch (VMAs are no longer shared, and there are now region structs).
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Tested-by: NMike Frysinger <vapier.adi@gmail.com>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      8feae131
    • R
      ring_buffer: fix ring_buffer_event_length() · 465634ad
      Robert Richter 提交于
      Function ring_buffer_event_length() provides an interface to detect
      the length of data stored in an entry. However, the length contains
      offsets depending on the internal usage. This makes it unusable. This
      patch fixes this and now ring_buffer_event_length() returns the
      alligned length that has been used in ring_buffer_lock_reserve().
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRobert Richter <robert.richter@amd.com>
      465634ad
    • H
      stop_machine/cpu hotplug: fix disable_nonboot_cpus · a0e280e0
      Heiko Carstens 提交于
      disable_nonboot_cpus calls _cpu_down. But _cpu_down requires that the
      caller already created the stop_machine workqueue (like cpu_down does).
      Otherwise a call to stop_machine will lead to accesses to random memory
      regions.
      
      When introducing this new interface (9ea09af3
      "stop_machine: introduce stop_machine_create/destroy") I missed the second
      call site of _cpu_down.
      So add the missing stop_machine_create/destroy calls to disable_nonboot_cpus
      as well.
      
      Fixes suspend-to-ram/disk and also this bug:
      
      [  286.547348] BUG: unable to handle kernel paging request at 6b6b6b6b
      [  286.548940] IP: [<c0150ca4>] __stop_machine+0x88/0xe3
      [  286.550598] Oops: 0002 [#1] SMP
      [  286.560580] Pid: 3273, comm: halt Not tainted (2.6.28-06127-g238c6d54
      [  286.560580] EIP: is at __stop_machine+0x88/0xe3
      [  286.560580] Process halt (pid: 3273, ti=f1a28000 task=f4530f30
      [  286.560580] Call Trace:
      [  286.560580]  [<c03d04e4>] ? _cpu_down+0x10f/0x234
      [  286.560580]  [<c012a57e>] ? disable_nonboot_cpus+0x58/0xdc
      [  286.560580]  [<c01360c0>] ? kernel_poweroff+0x22/0x39
      [  286.560580]  [<c0136301>] ? sys_reboot+0xde/0x14c
      [  286.560580]  [<c01331b2>] ? complete_signal+0x179/0x191
      [  286.560580]  [<c0133396>] ? send_signal+0x1cc/0x1e1
      [  286.560580]  [<c03de418>] ? _spin_unlock_irqrestore+0x2d/0x3c
      [  286.560580]  [<c0133b65>] ? group_send_signal_info+0x58/0x61
      [  286.560580]  [<c0133b9e>] ? kill_pid_info+0x30/0x3a
      [  286.560580]  [<c0133d49>] ? sys_kill+0x75/0x13a
      [  286.560580]  [<c01a06cb>] ? mntput_no_expire+ox1f/0x101
      [  286.560580]  [<c019b3b3>] ? dput+0x1e/0x105
      [  286.560580]  [<c018ef87>] ?  __fput+0x150/0x158
      [  286.560580]  [<c0157abf>] ? audit_syscall_entry+0x137/0x159
      [  286.560580]  [<c010329f>] ? sysenter_do_call+0x12/0x34
      Reported-and-tested-by: N"Justin P. Mattock" <justinmattock@gmail.com>
      Reviewed-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Tested-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a0e280e0
    • A
      resource: allow MMIO exclusivity for device drivers · e8de1481
      Arjan van de Ven 提交于
      Device drivers that use pci_request_regions() (and similar APIs) have a
      reasonable expectation that they are the only ones accessing their device.
      As part of the e1000e hunt, we were afraid that some userland (X or some
      bootsplash stuff) was mapping the MMIO region that the driver thought it
      had exclusively via /dev/mem or via various sysfs resource mappings.
      
      This patch adds the option for device drivers to cause their reserved
      regions to the "banned from /dev/mem use" list, so now both kernel memory
      and device-exclusive MMIO regions are banned.
      NOTE: This is only active when CONFIG_STRICT_DEVMEM is set.
      
      In addition to the config option, a kernel parameter iomem=relaxed is
      provided for the cases where developers want to diagnose, in the field,
      drivers issues from userspace.
      Reviewed-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      e8de1481
    • A
      async: don't do the initcall stuff post boot · ad160d23
      Arjan van de Ven 提交于
      while tracking the asynchronous calls during boot using the initcall_debug
      convention is useful, doing it once the kernel is done is actually
      bad now that we use asynchronous operations post boot as well...
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      ad160d23
    • A
      async: Asynchronous function calls to speed up kernel boot · 22a9d645
      Arjan van de Ven 提交于
      Right now, most of the kernel boot is strictly synchronous, such that
      various hardware delays are done sequentially.
      
      In order to make the kernel boot faster, this patch introduces
      infrastructure to allow doing some of the initialization steps
      asynchronously, which will hide significant portions of the hardware delays
      in practice.
      
      In order to not change device order and other similar observables, this
      patch does NOT do full parallel initialization.
      
      Rather, it operates more in the way an out of order CPU does; the work may
      be done out of order and asynchronous, but the observable effects
      (instruction retiring for the CPU) are still done in the original sequence.
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      22a9d645
  4. 07 1月, 2009 2 次提交