10 Sep, 2010

5 commits

  • Signed-off-by: Tejun Heo
    Reported-by: Stephane Eranian

    Tejun Heo
     
  • Redefine __get_cpu_var() using this_cpu_ptr() which can be
    arch-optimized.

    Signed-off-by: Brian Gerst
    Signed-off-by: Tejun Heo

    Brian Gerst
     
  • Allow arches to implement __this_cpu_ptr, and provide an x86 version.

    Before:
    movq $foo, %rax
    movq %gs:this_cpu_off, %rdx
    addq %rdx, %rax

    After:
    movq $foo, %rax
    addq %gs:this_cpu_off, %rax

    The benefit is doing it in one less instruction and not clobbering
    a temporary register.

    tj: * Beefed up the comment a bit and renamed in-macro temp variable
    to match neighboring macros.

    * Folded fix for const pointer case found in linux-next.

    * Fixed sparse notation.

    Signed-off-by: Brian Gerst
    Signed-off-by: Tejun Heo

    Brian Gerst
     
  • Percpu allocator should clear memory before returning it but the km
    allocator forgot to do it. Fix it.

    Signed-off-by: Tejun Heo
    Reported-by: Peter Zijlstra
    Acked-by: Peter Zijlstra

    Tejun Heo
     
  • Commit bbddff05 (percpu: use percpu allocator on UP too) incorrectly
    excluded pcpu_build_alloc_info() on SMP configurations which use
    generic setup_per_cpu_area() like s390. The config ifdefs are
    becoming confusing. Fix and clean it up by,

    * Move pcpu_build_alloc_info() right on top of its two users -
    pcpu_{embed|page}_first_chunk() which are already in CONFIG_SMP
    block.

    * Define BUILD_{EMBED|PAGE}_FIRST_CHUNK which indicate whether each
    first chunk function needs to be included and use them to control
    inclusion of the three functions to reduce confusion.

    Signed-off-by: Tejun Heo
    Reported-by: Sachin Sant

    Tejun Heo
     

08 Sep, 2010

27 commits

  • 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: Tejun Heo
    Reviewed-by: Christoph Lameter
    Acked-by: Pekka Enberg

    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: Tejun Heo
    Reviewed-by: Christoph Lameter

    Tejun Heo
     
  • These functions are used only by percpu memory allocator on SMP.
    Don't build them on UP.

    Signed-off-by: Tejun Heo
    Cc: Nick Piggin
    Reviewed-by: Chrsitoph Lameter

    Tejun Heo
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
    PCI: bus speed strings should be const
    PCI hotplug: Fix build with CONFIG_ACPI unset
    PCI: PCIe: Remove the port driver module exit routine
    PCI: PCIe: Move PCIe PME code to the pcie directory
    PCI: PCIe: Disable PCIe port services during port initialization
    PCI: PCIe: Ask BIOS for control of all native services at once
    ACPI/PCI: Negotiate _OSC control bits before requesting them
    ACPI/PCI: Do not preserve _OSC control bits returned by a query
    ACPI/PCI: Make acpi_pci_query_osc() return control bits
    ACPI/PCI: Reorder checks in acpi_pci_osc_control_set()
    PCI: PCIe: Introduce commad line switch for disabling port services
    PCI: PCIe AER: Introduce pci_aer_available()
    x86/PCI: only define pci_domain_nr if PCI and PCI_DOMAINS are set
    PCI: provide stub pci_domain_nr function for !CONFIG_PCI configs

    Linus Torvalds
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    xfs: Make fiemap work with sparse files
    xfs: prevent 32bit overflow in space reservation
    xfs: Disallow 32bit project quota id
    xfs: improve buffer cache hash scalability

    Linus Torvalds
     
  • * 'for-linus' of git://android.kernel.org/kernel/tegra:
    [ARM] tegra: Add ZRELADDR default for ARCH_TEGRA

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha-2.6:
    alpha: Fix printk format errors
    alpha: convert perf_event to use local_t
    Fix call to replaced SuperIO functions
    alpha: remove homegrown L1_CACHE_ALIGN macro

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    9p: potential ERR_PTR() dereference

    Linus Torvalds
     
  • * 'for-linus' of git://neil.brown.name/md:
    md: resolve confusion of MD_CHANGE_CLEAN
    md: don't clear MD_CHANGE_CLEAN in md_update_sb() for external arrays
    Move .gitignore from drivers/md to lib/raid6

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    Revert "hwrng: n2-drv - remove casts from void*"
    crypto: testmgr - Default to no tests
    crypto: testmgr - Fix test disabling option
    crypto: hash - Fix handling of small unaligned buffers

    Linus Torvalds
     
  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
    powerpc/pseries: Correct rtas_data_buf locking in dlpar code
    powerpc/85xx: Add P1021 PCI IDs and quirks
    arch/powerpc/sysdev/qe_lib/qe.c: Add of_node_put to avoid memory leak
    arch/powerpc/platforms/83xx/mpc837x_mds.c: Add missing iounmap
    fsl_rio: fix compile errors
    powerpc/85xx: Fix compile issue with p1022_ds due to lmb rename to memblock
    powerpc/85xx: Fix compilation of mpc85xx_mds.c
    powerpc: Don't use kernel stack with translation off
    powerpc/perf_event: Reduce latency of calling perf_event_do_pending
    powerpc/kexec: Adds correct calling convention for kexec purgatory

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
    percpu: fix a mismatch between code and comment
    percpu: fix a memory leak in pcpu_extend_area_map()
    percpu: add __percpu notations to UP allocator
    percpu: handle __percpu notations in UP accessors

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
    workqueue: use zalloc_cpumask_var() for gcwq->mayday_mask
    workqueue: fix GCWQ_DISASSOCIATED initialization
    workqueue: Add a workqueue chapter to the tracepoint docbook
    workqueue: fix cwq->nr_active underflow
    workqueue: improve destroy_workqueue() debuggability
    workqueue: mark lock acquisition on worker_maybe_bind_and_lock()
    workqueue: annotate lock context change
    workqueue: free rescuer on destroy_workqueue

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits)
    pkt_sched: Fix lockdep warning on est_tree_lock in gen_estimator
    ipvs: avoid oops for passive FTP
    Revert "sky2: don't do GRO on second port"
    gro: fix different skb headrooms
    bridge: Clear INET control block of SKBs passed into ip_fragment().
    3c59x: Remove incorrect locking; correct documented lock hierarchy
    sky2: don't do GRO on second port
    ipv4: minor fix about RPF in help of Kconfig
    xfrm_user: avoid a warning with some compiler
    net/sched/sch_hfsc.c: initialize parent's cl_cfmin properly in init_vf()
    pxa168_eth: fix a mdiobus leak
    net sched: fix kernel leak in act_police
    vhost: stop worker only if created
    MAINTAINERS: Add ehea driver as Supported
    ath9k_hw: fix parsing of HT40 5 GHz CTLs
    ath9k_hw: Fix EEPROM uncompress block reading on AR9003
    wireless: register wiphy rfkill w/o holding cfg80211_mutex
    netlink: Make NETLINK_USERSOCK work again.
    irda: Correctly clean up self->ias_obj on irda_bind() failure.
    wireless extensions: fix kernel heap content leak
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
    Staging: wlan-ng: Explicitly set some fields in cfg80211 interface
    Staging: octeon: depends on NETDEVICES
    Staging: spectra: depend on X86_MRST
    Staging: zram: free device memory when init fails
    Staging: rt2870sta: Add more device IDs from vendor drivers
    staging: comedi das08_cs.c: Fix io_req_t conversion
    staging: spectra needs
    staging: hv: Fixed lockup problem with bounce_buffer scatter list
    staging: hv: Increased storvsc ringbuffer and max_io_requests
    staging: hv: Fixed the value of the 64bit-hole inside ring buffer
    staging: hv: Fixed bounce kmap problem by using correct index
    staging: hv: Fix missing functions for net_device_ops

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
    sysfs: checking for NULL instead of ERR_PTR

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
    USB: ftdi_sio: Added custom PIDs for ChamSys products
    USB: cdc-acm: Fixing crash when ACM probing interfaces with no endpoint descriptors.
    USB: cdc-acm: Add pseudo modem without AT command capabilities
    USB: cxacru: Use a bulk/int URB to access the command endpoint
    usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters.
    USB: cdc-acm: Adding second ACM channel support for various Nokia and one Samsung phones
    usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P.
    USB: ssu100: turn off debug flag
    usb: allow drivers to use allocated bandwidth until unbound
    USB: cp210x usb driver: add USB_DEVICE for Pirelli DP-L10 mobile.
    USB: cp210x: Add B&G H3000 link cable ID
    USB: CP210x Add new device ID
    USB: option: fix incorrect novatel entries
    USB: Fix kernel oops with g_ether and Windows
    USB: rndis: section mismatch fix
    USB: ehci-ppc-of: problems in unwind
    USB: s3c-hsotg: Remove DEBUG define

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
    tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver
    serial: bfin_sport_uart: restore transmit frame sync fix
    serial: fix port type conflict between NS16550A & U6_16550A
    MAINTAINERS: orphan isicom
    vt: Fix console corruption on driver hand-over.

    Linus Torvalds
     
  • * 'linux-next' of git://git.infradead.org/ubi-2.6:
    UBI: do not oops when erroneous PEB is scheduled for scrubbing
    UBI: fix kconfig unmet dependency
    UBI: fix forward compatibility
    UBI: eliminate update of list_for_each_entry loop cursor

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
    nilfs2: fix leak of shadow dat inode in error path of load_nilfs

    Linus Torvalds
     
  • * 'drm-intel-fixes' of git://anongit.freedesktop.org/~ickle/drm-intel: (25 commits)
    intel_agp,i915: Add more sandybridge graphics device ids
    drm/i915: Enable MI_FLUSH on Sandybridge
    agp/intel: Fix cache control for Sandybridge
    agp/intel: use #ifdef idiom for intel-agp.h
    agp/intel: fix physical address mask bits for sandybridge
    drm/i915: Prevent double dpms on
    drm/i915: Avoid use of uninitialised values when disabling panel-fitter
    drm/i915: Avoid pageflipping freeze when we miss the flip prepare interrupt
    drm/i915: Tightly scope intel_encoder to prevent invalid use
    drm/i915: Allocate the PCI resource for the MCHBAR
    drm/i915/dp: Really try 5 times before giving up.
    drm/i915/sdvo: Restore guess of the DDC bus in absence of VBIOS
    drm/i915/dp: Boost timeout for enabling transcoder to 100ms
    drm/i915: Re-use set_base_atomic to share setting of the display registers
    drm/i915: Fix offset page-flips on i965+
    drm/i915: Include a generation number in the device info
    i915: return -EFAULT if copy_to_user fails
    i915: return -EFAULT if copy_to_user fails
    agp/intel: Promote warning about failure to setup flush to error.
    drm/i915: overlay on gen2 can't address above 1G
    ...

    Linus Torvalds
     
  • * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm: Do not force 1024x768 modes on unknown connectors
    drm/kms: Add a module parameter to disable polling
    drm/radeon/kms: fix tv-out on avivo asics
    drm/radeon/kms/evergreen: fix gpu hangs in userspace accel code
    drm/nv50: initialize ramht_refs list for faked 0 channel
    drm/nouveau: Don't take struct_mutex around the pushbuf IOCTL.
    drm/nouveau: Take fence spinlock before reading the last sequence.
    drm/radeon/kms/evergreen: work around bad data in some i2c tables
    drm/radeon/kms: properly set crtc high base on r7xx
    drm/radeon/kms: fix tv module parameter
    drm/radeon/kms: force legacy pll algo for RV515 LVDS
    drm/radeon/kms: remove useless clock code
    drm/radeon/kms: fix a regression on r7xx AGP due to the HDP flush fix
    drm/radeon/kms: use tracked values for sclk and mclk

    Linus Torvalds
     
  • Recent changes to linker segments that hold per-cpu data broke linking
    for m68knommu targets:

    LD vmlinux
    /usr/local/bin/m68k-uclinux-ld.real: error: no memory region specified for loadable section `.data..shared_aligned'

    Add missing segments into the m68knommu linker script.

    Signed-off-by: Greg Ungerer
    Signed-off-by: Linus Torvalds

    Greg Ungerer
     
  • Fix missing consts in h8300's kernel_execve():

    arch/h8300/kernel/sys_h8300.c: In function 'kernel_execve':
    arch/h8300/kernel/sys_h8300.c:59: warning: initialization from incompatible pointer type
    arch/h8300/kernel/sys_h8300.c:60: warning: initialization from incompatible pointer type

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Fix h8300's die() to take care of a number of problems:

    CC arch/h8300/kernel/traps.o
    In file included from arch/h8300/include/asm/bitops.h:10,
    from include/linux/bitops.h:22,
    from include/linux/kernel.h:17,
    from include/linux/sched.h:54,
    from arch/h8300/kernel/traps.c:18:
    arch/h8300/include/asm/system.h:136: warning: 'struct pt_regs' declared inside parameter list
    arch/h8300/include/asm/system.h:136: warning: its scope is only this definition or declaration, which is probably not what you want
    arch/h8300/kernel/traps.c:100: error: conflicting types for 'die'
    arch/h8300/include/asm/system.h:136: error: previous declaration of 'die' was here
    make[2]: *** [arch/h8300/kernel/traps.o] Error 1

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Fix h8300's asm/atomic.h to store the IRQ flags in an unsigned long to deal
    with warnings of the following type:

    arch/h8300/include/asm/atomic.h: In function 'atomic_add_return':
    arch/h8300/include/asm/atomic.h:22: warning: comparison of distinct pointer types lacks a cast
    arch/h8300/include/asm/atomic.h:24: warning: comparison of distinct pointer types lacks a cast

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Sanity check the flags passed to change_mnt_propagation(). Exactly
    one flag should be set. Return EINVAL otherwise.

    Userspace can pass in arbitrary combinations of MS_* flags to mount().
    do_change_type() is called if any of MS_SHARED, MS_PRIVATE, MS_SLAVE,
    or MS_UNBINDABLE is set. do_change_type() clears MS_REC and then
    calls change_mnt_propagation() with the rest of the user-supplied
    flags. change_mnt_propagation() clearly assumes only one flag is set
    but do_change_type() does not check that this is true. For example,
    mount() with flags MS_SHARED | MS_RDONLY does not actually make the
    mount shared or read-only but does clear MNT_UNBINDABLE.

    Signed-off-by: Valerie Aurora
    Signed-off-by: Linus Torvalds

    Valerie Aurora
     

07 Sep, 2010

8 commits