1. 02 10月, 2010 4 次提交
    • T
      percpu: use percpu allocator on UP too · 9b8327bb
      Tejun Heo 提交于
      On UP, percpu allocations were redirected to kmalloc.  This has the
      following problems.
      
      * For certain amount of allocations (determined by
        PERCPU_DYNAMIC_EARLY_SLOTS and PERCPU_DYNAMIC_EARLY_SIZE), percpu
        allocator can be used before the usual kernel memory allocator is
        brought online.  On SMP, this is used to initialize the kernel
        memory allocator.
      
      * percpu allocator honors alignment upto PAGE_SIZE but kmalloc()
        doesn't.  For example, workqueue makes use of larger alignments for
        cpu_workqueues.
      
      Currently, users of percpu allocators need to handle UP differently,
      which is somewhat fragile and ugly.  Other than small amount of
      memory, there isn't much to lose by enabling percpu allocator on UP.
      It can simply use kernel memory based chunk allocation which was added
      for SMP archs w/o MMUs.
      
      This patch removes mm/percpu_up.c, builds mm/percpu.c on UP too and
      makes UP build use percpu-km.  As percpu addresses and kernel
      addresses are always identity mapped and static percpu variables don't
      need any special treatment, nothing is arch dependent and mm/percpu.c
      implements generic setup_per_cpu_areas() for UP.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      9b8327bb
    • T
      percpu: reduce PCPU_MIN_UNIT_SIZE to 32k · a7b6b77b
      Tejun Heo 提交于
      In preparation of enabling percpu allocator for UP, reduce
      PCPU_MIN_UNIT_SIZE to 32k.  On UP, the first chunk doesn't have to
      include static percpu variables and chunk size can be smaller which is
      important as UP percpu allocator will use contiguous kernel memory to
      populate chunks.
      
      PCPU_MIN_UNIT_SIZE also determines the maximum supported allocation
      size but 32k should still be enough.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      a7b6b77b
    • T
      vmalloc: pcpu_get/free_vm_areas() aren't needed on UP · 0bc14062
      Tejun Heo 提交于
      These functions are used only by percpu memory allocator on SMP.
      Don't build them on UP.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Nick Piggin <npiggin@kernel.dk>
      0bc14062
    • C
      slub: Dynamically size kmalloc cache allocations · 51df1142
      Christoph Lameter 提交于
      kmalloc caches are statically defined and may take up a lot of space just
      because the sizes of the node array has to be dimensioned for the largest
      node count supported.
      
      This patch makes the size of the kmem_cache structure dynamic throughout by
      creating a kmem_cache slab cache for the kmem_cache objects. The bootstrap
      occurs by allocating the initial one or two kmem_cache objects from the
      page allocator.
      
      C2->C3
      	- Fix various issues indicated by David
      	- Make create kmalloc_cache return a kmem_cache * pointer.
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NChristoph Lameter <cl@linux-foundation.org>
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      51df1142
  2. 28 9月, 2010 1 次提交
  3. 23 9月, 2010 3 次提交
  4. 22 9月, 2010 1 次提交
  5. 18 9月, 2010 1 次提交
  6. 15 9月, 2010 1 次提交
    • H
      compat: Make compat_alloc_user_space() incorporate the access_ok() · c41d68a5
      H. Peter Anvin 提交于
      compat_alloc_user_space() expects the caller to independently call
      access_ok() to verify the returned area.  A missing call could
      introduce problems on some architectures.
      
      This patch incorporates the access_ok() check into
      compat_alloc_user_space() and also adds a sanity check on the length.
      The existing compat_alloc_user_space() implementations are renamed
      arch_compat_alloc_user_space() and are used as part of the
      implementation of the new global function.
      
      This patch assumes NULL will cause __get_user()/__put_user() to either
      fail or access userspace on all architectures.  This should be
      followed by checking the return value of compat_access_user_space()
      for NULL in the callers, at which time the access_ok() in the callers
      can also be removed.
      Reported-by: NBen Hawkes <hawkes@sota.gen.nz>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NChris Metcalf <cmetcalf@tilera.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NTony Luck <tony.luck@intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: James Bottomley <jejb@parisc-linux.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: <stable@kernel.org>
      c41d68a5
  7. 13 9月, 2010 2 次提交
  8. 10 9月, 2010 12 次提交
  9. 09 9月, 2010 2 次提交
    • S
      dquot: do full inode dirty in allocating space · d530148a
      Shaohua Li 提交于
      Alex Shi found a regression when doing ffsb test. The test has several threads,
      and each thread creates a small file, write to it and then delete it. ffsb
      reports about 20% regression and Alex bisected it to 43d2932d. The test
      will call __mark_inode_dirty 3 times. without this commit, we only take
      inode_lock one time, while with it, we take the lock 3 times with flags (
      I_DIRTY_SYNC,I_DIRTY_PAGES,I_DIRTY). Perf shows the lock contention increased
      too much. Below proposed patch fixes it.
      
      fs is allocating blocks, which usually means file writes and the inode
      will be dirtied soon. We fully dirty the inode to reduce some inode_lock
      contention in several calls of __mark_inode_dirty.
      
      Jan Kara: Added comment.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NAlex Shi <alex.shi@intel.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      d530148a
    • F
      spi/dw_spi: clean the cs_control code · e3e55ff5
      Feng Tang 提交于
      commit 052dc7c4i "spi/dw_spi: conditional transfer mode change"
      introduced cs_control code, which has a bug by using bit offset
      for spi mode to set transfer mode in control register. Also it
      forces devices who don't need cs_control to re-configure the
      control registers for each spi transfer. This patch will fix them
      Signed-off-by: NFeng Tang <feng.tang@intel.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      e3e55ff5
  10. 08 9月, 2010 1 次提交
    • T
      semaphore: Add DEFINE_SEMAPHORE · febc88c5
      Thomas Gleixner 提交于
      The full cleanup of init_MUTEX[_LOCKED] and DECLARE_MUTEX has not been
      done. Some of the users are real semaphores and we should name them as
      such instead of confusing everyone with "MUTEX".
      
      Provide the infrastructure to get finally rid of init_MUTEX[_LOCKED]
      and DECLARE_MUTEX.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Christoph Hellwig <hch@infradead.org>
      LKML-Reference: <20100907125054.795929962@linutronix.de>
      febc88c5
  11. 07 9月, 2010 1 次提交
  12. 05 9月, 2010 2 次提交
  13. 04 9月, 2010 1 次提交
  14. 03 9月, 2010 1 次提交
  15. 01 9月, 2010 2 次提交
  16. 29 8月, 2010 1 次提交
  17. 28 8月, 2010 1 次提交
  18. 27 8月, 2010 1 次提交
  19. 25 8月, 2010 2 次提交
    • T
      workqueue: fix cwq->nr_active underflow · 8a2e8e5d
      Tejun Heo 提交于
      cwq->nr_active is used to keep track of how many work items are active
      for the cpu workqueue, where 'active' is defined as either pending on
      global worklist or executing.  This is used to implement the
      max_active limit and workqueue freezing.  If a work item is queued
      after nr_active has already reached max_active, the work item doesn't
      increment nr_active and is put on the delayed queue and gets activated
      later as previous active work items retire.
      
      try_to_grab_pending() which is used in the cancellation path
      unconditionally decremented nr_active whether the work item being
      cancelled is currently active or delayed, so cancelling a delayed work
      item makes nr_active underflow.  This breaks max_active enforcement
      and triggers BUG_ON() in destroy_workqueue() later on.
      
      This patch fixes this bug by adding a flag WORK_STRUCT_DELAYED, which
      is set while a work item in on the delayed list and making
      try_to_grab_pending() decrement nr_active iff the work item is
      currently active.
      
      The addition of the flag enlarges cwq alignment to 256 bytes which is
      getting a bit too large.  It's scheduled to be reduced back to 128
      bytes by merging WORK_STRUCT_PENDING and WORK_STRUCT_CWQ in the next
      devel cycle.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NJohannes Berg <johannes@sipsolutions.net>
      8a2e8e5d
    • R
      ACPI/PCI: Negotiate _OSC control bits before requesting them · 75fb60f2
      Rafael J. Wysocki 提交于
      It is possible that the BIOS will not grant control of all _OSC
      features requested via acpi_pci_osc_control_set(), so it is
      recommended to negotiate the final set of _OSC features with the
      query flag set before calling _OSC to request control of these
      features.
      
      To implement it, rework acpi_pci_osc_control_set() so that the caller
      can specify the mask of _OSC control bits to negotiate and the mask
      of _OSC control bits that are absolutely necessary to it.  Then,
      acpi_pci_osc_control_set() will run _OSC queries in a loop until
      the mask of _OSC control bits returned by the BIOS is equal to the
      mask passed to it.  Also, before running the _OSC request
      acpi_pci_osc_control_set() will check if the caller's required
      control bits are present in the final mask.
      
      Using this mechanism we will be able to avoid situations in which the
      BIOS doesn't grant control of certain _OSC features, because they
      depend on some other _OSC features that have not been requested.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      75fb60f2