1. 14 2月, 2015 10 次提交
    • R
      lib: bitmap: eliminate branch in __bitmap_shift_right · 9d8a6b2a
      Rasmus Villemoes 提交于
      We can shift the bits from lower and upper into place before assembling
      dst[k]; moving the shift of upper into the branch where we already know
      that rem is non-zero allows us to remove a conditional.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9d8a6b2a
    • R
      lib: bitmap: change bitmap_shift_right to take unsigned parameters · 2fbad299
      Rasmus Villemoes 提交于
      I've previously changed the nbits parameter of most bitmap_* functions to
      unsigned; now it is bitmap_shift_{left,right}'s turn.  This alone saves
      some .text, but while at it I found that there were a few other things one
      could do.  The end result of these seven patches is
      
        $ scripts/bloat-o-meter /tmp/bitmap.o.{old,new}
        add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-328 (-328)
        function                                     old     new   delta
        __bitmap_shift_right                         384     226    -158
        __bitmap_shift_left                          306     136    -170
      
      and less importantly also a smaller stack footprint
      
        $ stack-o-meter.pl master bitmap
        file                 function                       old  new  delta
        lib/bitmap.o         __bitmap_shift_right             24    8  -16
        lib/bitmap.o         __bitmap_shift_left              24    0  -24
      
      For each pair of 0 <= shift <= nbits <= 256 I've tested the end result
      with a few randomly filled src buffers (including garbage beyond nbits),
      in each case verifying that the shift {left,right}-most bits of dst are
      zero and the remaining nbits-shift bits correspond to src, so I'm fairly
      confident I didn't screw up.  That hasn't stopped me from being wrong
      before, though.
      
      This patch (of 7):
      
      gcc can generate slightly better code for stuff like "nbits %
      BITS_PER_LONG" when it knows nbits is not negative.  Since negative size
      bitmaps or shift amounts don't make sense, change these parameters of
      bitmap_shift_right to unsigned.
      
      The expressions involving "lim - 1" are still ok, since if lim is 0 the
      loop is never executed.
      
      Also use "shift" and "nbits" consistently for the parameter names.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2fbad299
    • R
      lib/bitmap.c: elide bitmap_copy_le on little-endian · e8f24278
      Rasmus Villemoes 提交于
      On little-endian, there's no reason to have an extra, presumably less
      efficient, way of copying a bitmap.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e8f24278
    • R
      lib/bitmap.c: change prototype of bitmap_copy_le · 9b6c2d2e
      Rasmus Villemoes 提交于
      Make the prototype of bitmap_copy_le the same as bitmap_copy's.  All other
      bitmap_* functions take unsigned long* parameters; there's no reason this
      should be special.
      
      The only current user is the static inline uwb_mas_bm_copy_le, which
      already does the void* laundering, so the end users can pass their u8 or
      __le32 buffers without a cast.
      
      Furthermore, this allows us to simply let bitmap_copy_le be an alias for
      bitmap_copy on little-endian; see next patch.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9b6c2d2e
    • L
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds · db3ecdee
      Linus Torvalds 提交于
      Pull LED subsystem update from Bryan Wu:
       "The big change of LED subsystem is introducing a new LED class for
        Flash type LEDs which will be used for V4L2 subsystem.
      
        Also we got some cleanup and fixes"
      
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
        leds: leds-gpio: Pass on error codes unmodified
        DT: leds: Add led-sources property
        leds: Add LED Flash class extension to the LED subsystem
        leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack
        leds: Use setup_timer
        leds: Don't allow brightness values greater than max_brightness
        DT: leds: Add flash LED devices related properties
      db3ecdee
    • L
      Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · a42cf70e
      Linus Torvalds 提交于
      Pull module update from Rusty Russell:
       "Trivial cleanups, mainly"
      
      * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
        module: Replace over-engineered nested sleep
        module: Annotate nested sleep in resolve_symbol()
        module: Remove double spaces in module verification taint message
        kernel/module.c: Free lock-classes if parse_args failed
        module: set ksymtab/kcrctab* section addresses to 0x0
      a42cf70e
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · f1252515
      Linus Torvalds 提交于
      Pull arch/tile changes from Chris Metcalf:
       "Not much in this batch, just some minor cleanups"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tile: change MAINTAINERS website from tilera.com to ezchip.com
        tile: enable sparse checks for get/put_user
        tile: fix put_user sparse errors
        tile: default to little endian on older toolchains
      f1252515
    • L
      Revert "x86/apic: Only disable CPU x2apic mode when necessary" · 8329aa9f
      Linus Torvalds 提交于
      This reverts commit 5fcee53c.
      
      It causes the suspend to fail on at least the Chromebook Pixel, possibly
      other platforms too.
      
      Joerg Roedel points out that the logic should probably have been
      
                      if (max_physical_apicid > 255 ||
                          !(IS_ENABLED(CONFIG_HYPERVISOR_GUEST) &&
                            hypervisor_x2apic_available())) {
      
      instead, but since the code is not in any fast-path, so we can just live
      without that optimization and just revert to the original code.
      Acked-by: NJoerg Roedel <joro@8bytes.org>
      Acked-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8329aa9f
    • C
    • L
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · b9085bcb
      Linus Torvalds 提交于
      Pull KVM update from Paolo Bonzini:
       "Fairly small update, but there are some interesting new features.
      
        Common:
           Optional support for adding a small amount of polling on each HLT
           instruction executed in the guest (or equivalent for other
           architectures).  This can improve latency up to 50% on some
           scenarios (e.g. O_DSYNC writes or TCP_RR netperf tests).  This
           also has to be enabled manually for now, but the plan is to
           auto-tune this in the future.
      
        ARM/ARM64:
           The highlights are support for GICv3 emulation and dirty page
           tracking
      
        s390:
           Several optimizations and bugfixes.  Also a first: a feature
           exposed by KVM (UUID and long guest name in /proc/sysinfo) before
           it is available in IBM's hypervisor! :)
      
        MIPS:
           Bugfixes.
      
        x86:
           Support for PML (page modification logging, a new feature in
           Broadwell Xeons that speeds up dirty page tracking), nested
           virtualization improvements (nested APICv---a nice optimization),
           usual round of emulation fixes.
      
           There is also a new option to reduce latency of the TSC deadline
           timer in the guest; this needs to be tuned manually.
      
           Some commits are common between this pull and Catalin's; I see you
           have already included his tree.
      
        Powerpc:
           Nothing yet.
      
           The KVM/PPC changes will come in through the PPC maintainers,
           because I haven't received them yet and I might end up being
           offline for some part of next week"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (130 commits)
        KVM: ia64: drop kvm.h from installed user headers
        KVM: x86: fix build with !CONFIG_SMP
        KVM: x86: emulate: correct page fault error code for NoWrite instructions
        KVM: Disable compat ioctl for s390
        KVM: s390: add cpu model support
        KVM: s390: use facilities and cpu_id per KVM
        KVM: s390/CPACF: Choose crypto control block format
        s390/kernel: Update /proc/sysinfo file with Extended Name and UUID
        KVM: s390: reenable LPP facility
        KVM: s390: floating irqs: fix user triggerable endless loop
        kvm: add halt_poll_ns module parameter
        kvm: remove KVM_MMIO_SIZE
        KVM: MIPS: Don't leak FPU/DSP to guest
        KVM: MIPS: Disable HTW while in guest
        KVM: nVMX: Enable nested posted interrupt processing
        KVM: nVMX: Enable nested virtual interrupt delivery
        KVM: nVMX: Enable nested apic register virtualization
        KVM: nVMX: Make nested control MSRs per-cpu
        KVM: nVMX: Enable nested virtualize x2apic mode
        KVM: nVMX: Prepare for using hardware MSR bitmap
        ...
      b9085bcb
  2. 13 2月, 2015 30 次提交