1. 01 5月, 2012 7 次提交
    • L
      rcu: Implement a variant of Peter's SRCU algorithm · b52ce066
      Lai Jiangshan 提交于
      This commit implements a variant of Peter's algorithm, which may be found
      at https://lkml.org/lkml/2012/2/1/119.
      
      o	Make the checking lock-free to enable parallel checking.
      	Parallel checking is required when (1) the original checking
      	task is preempted for a long time, (2) sychronize_srcu_expedited()
      	starts during an ongoing SRCU grace period, or (3) we wish to
      	avoid acquiring a lock.
      
      o	Since the checking is lock-free, we avoid a mutex in state machine
      	for call_srcu().
      
      o	Remove the SRCU_REF_MASK and remove the coupling with the flipping.
      	This might allow us to remove the preempt_disable() in future
      	versions, though such removal will need great care because it
      	rescinds the one-old-reader-per-CPU guarantee.
      
      o	Remove a smp_mb(), simplify the comments and make the smp_mb() pairs
      	more intuitive.
      Inspired-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      b52ce066
    • L
      rcu: Improve SRCU's wait_idx() comments · 18108ebf
      Lai Jiangshan 提交于
      The safety of SRCU is provided byy wait_idx() rather than flipping.
      The flipping actually prevents starvation.
      
      This commit therefore updates the comments to more accurately and
      precisely describe what is going on.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      18108ebf
    • L
      rcu: Flip ->completed only once per SRCU grace period · 944ce9af
      Lai Jiangshan 提交于
      This is an optimization of the SRCU grace period.  To guard against
      preempted readers with old values of the counter, it suffices to scan the
      old counters once more, then flip ->completed only one time.  The reason
      this works is that the old readers must have incremented the old set of
      counters (if they have not yet incremented, then their critical section
      starts after this grace period, so they may be safely ignored).
      
      This commit therefore optimizes the second flip out in favor of a simple
      rescan.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      944ce9af
    • L
      rcu: Increment upper bit only for srcu_read_lock() · 440253c1
      Lai Jiangshan 提交于
      The purpose of the upper bit of SRCU's per-CPU counters is to guarantee
      that no reasonable series of srcu_read_lock() and srcu_read_unlock()
      operations can return the value of the counter to its original value.
      This guarantee is require only after the index has been switched to
      the other set of counters, so at most one srcu_read_lock() can affect
      a given CPU's counter.  The number of srcu_read_unlock() operations
      on a given counter is limited to the number of tasks in the system,
      which given the Linux kernel's current structure is limited to far less
      than 2^30 on 32-bit systems and far less than 2^62 on 64-bit systems.
      (Something about a limited number of bytes in the kernel's address space.)
      
      Therefore, if srcu_read_lock() increments the upper bits, then
      srcu_read_unlock() need not do so.  In this case, an srcu_read_lock() and
      an srcu_read_unlock() will flip the lower bit of the upper field of the
      counter.  An unreasonably large additional number of srcu_read_unlock()
      operations would be required to return the counter to its initial value,
      thus preserving the guarantee.
      
      This commit takes this approach, which further allows it to shrink
      the size of the upper field to one bit, making the number of
      srcu_read_unlock() operations required to return the counter to its
      initial value even more unreasonable than before.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      440253c1
    • L
      rcu: Remove fast check path from __synchronize_srcu() · 4b7a3e9e
      Lai Jiangshan 提交于
      The fastpath in __synchronize_srcu() is designed to handle cases where
      there are a large number of concurrent calls for the same srcu_struct
      structure.  However, the Linux kernel currently does not use SRCU in
      this manner, so remove the fastpath checks for simplicity.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      4b7a3e9e
    • P
      rcu: Direct algorithmic SRCU implementation · cef50120
      Paul E. McKenney 提交于
      The current implementation of synchronize_srcu_expedited() can cause
      severe OS jitter due to its use of synchronize_sched(), which in turn
      invokes try_stop_cpus(), which causes each CPU to be sent an IPI.
      This can result in severe performance degradation for real-time workloads
      and especially for short-interation-length HPC workloads.  Furthermore,
      because only one instance of try_stop_cpus() can be making forward progress
      at a given time, only one instance of synchronize_srcu_expedited() can
      make forward progress at a time, even if they are all operating on
      distinct srcu_struct structures.
      
      This commit, inspired by an earlier implementation by Peter Zijlstra
      (https://lkml.org/lkml/2012/1/31/211) and by further offline discussions,
      takes a strictly algorithmic bits-in-memory approach.  This has the
      disadvantage of requiring one explicit memory-barrier instruction in
      each of srcu_read_lock() and srcu_read_unlock(), but on the other hand
      completely dispenses with OS jitter and furthermore allows SRCU to be
      used freely by CPUs that RCU believes to be idle or offline.
      
      The update-side implementation handles the single read-side memory
      barrier by rechecking the per-CPU counters after summing them and
      by running through the update-side state machine twice.
      
      This implementation has passed moderate rcutorture testing on both
      x86 and Power.  Also updated to use this_cpu_ptr() instead of per_cpu_ptr(),
      as suggested by Peter Zijlstra.
      Reported-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Reviewed-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      cef50120
    • P
      rcu: Introduce rcutorture testing for rcu_barrier() · fae4b54f
      Paul E. McKenney 提交于
      Although rcutorture does invoke rcu_barrier() and friends, it cannot
      really be called a torture test given that it invokes them only once
      at the end of the test.  This commit therefore introduces heavy-duty
      rcutorture testing for rcu_barrier(), which may be carried out
      concurrently with normal rcutorture testing.
      Signed-off-by: NPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      fae4b54f
  2. 25 4月, 2012 1 次提交
  3. 22 4月, 2012 6 次提交
    • L
      Linux 3.4-rc4 · 66f75a5d
      Linus Torvalds 提交于
      66f75a5d
    • Y
      sparc32,leon: add notify_cpu_starting() · e9a5ea18
      Yong Zhang 提交于
      Otherwise cpu_active_mask will not set, which lead to other issue.
      Signed-off-by: NYong Zhang <yong.zhang0@gmail.com>
      Signed-off-by: NKonrad Eisele <konrad@gaisler.com>
      Reviewed-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9a5ea18
    • L
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 8f4f9d4d
      Linus Torvalds 提交于
      Pull "ARM: SoC fixes" from Olof Johansson:
       * at91, ux500, imx, omap and bcmring:
        - at91 fixes for =m driver build issues, irqdomain fixes and config
          dependency fixes
        - ux500 kconfig dependency fixes and a  smp wakeup bugfix
        - imx idle bugfix and build fix due to irq domain changes
        - omap uart pinmux fixes, softreset regression revert and misc fixes
        - bcmring build error regression fix
      
       * ux500 and imx had some small defconfig updates in this branch
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (27 commits)
        ARM: bcmring: fix UART declarations
        ARM: imx: Fix imx5 idle logic bug
        ARM: imx27-dt: Fix build due to removal of irq_domain_add_simple()
        ARM: imx_v4_v5_defconfig: Add support for CONFIG_REGULATOR_FIXED_VOLTAGE
        ARM: OMAP1: DMTIMER: fix broken timer clock source selection
        ARM: OMAP: serial: Fix the ocp smart idlemode handling bug
        ARM: OMAP2+: UART: Fix incorrect population of default uart pads
        ARM: OMAP: sram: fix BUG in dpll code for !PM case
        dmaengine: Kconfig: fix Atmel at_hdmac entry
        USB: gadget/at91_udc: add gpio_to_irq() function to vbus interrupt
        USB: ohci-at91: change annotations for probe/remove functions
        leds-atmel-pwm.c: Make pwmled_probe() __devinit
        ARM: at91: fix at91sam9261ek Ethernet dm9000 irq
        ARM: at91: fix rm9200ek flash size
        ARM: at91: remove empty at91_init_serial function
        ARM: at91: fix typo in at91_pmc_base assembly declaration
        ARM: at91: Export at91_matrix_base
        ARM: at91: Export at91_pmc_base
        ARM: at91: Export at91_ramc_base
        ARM: at91: Export at91_st_base
        ...
      8f4f9d4d
    • L
      Merge tag 'mmc-fixes-for-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 126a3483
      Linus Torvalds 提交于
      Pull MMC fixes from Chris Ball:
       - Build fix for omap_hsmmc with OF against 3.4-rc1.
       - Fix CONFIG_MMC_UNSAFE_RESUME semantics regression against 3.3, which
         broke hotplug card detection when UNSAFE_RESUME is set.
       - Fix a race condition in omap_hsmmc with runtime PM.
       - Fix two libertas SDIO-powered-resume regressions.
       - Small fixes for discard/sanitize, dw_mmc, cd-gpio and esdhc-imx.
      
      * tag 'mmc-fixes-for-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
        mmc: core: Do not pre-claim host in suspend
        mmc: dw_mmc: prevent NULL dereference for dma_ops
        mmc: unbreak sdhci-esdhc-imx on i.MX25
        mmc: cd-gpio: Include header to pickup exported symbol prototypes
        mmc: sdhci: refine non-removable card checking for card detection
        mmc: dw_mmc: Fix switch from DMA to PIO
        mmc: remove MMC bus legacy suspend/resume method
        mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
        mmc: omap_hsmmc: build fix for CONFIG_OF=y and CONFIG_MMC_OMAP_HS=m
        mmc: fixes for eMMC v4.5 sanitize operation
        mmc: fixes for eMMC v4.5 discard operation
      126a3483
    • L
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 88981596
      Linus Torvalds 提交于
      Pull media fixes from Mauro Carvalho Chehab:
       - Fixes a regression at DVB core when switching from DVB-S2 to DVB-S on
         Kaffeine (Fedora 16 Bugzilla #812895);
       - Fixes a mutex unlock at an error condition at drx-k;
       - Fix winbond-cir set mode;
       - mt9m032: Fix a compilation breakage with some random Kconfig;
       - mt9m032: fix two dead locks;
       - xc5000: don't require an special firmware (that won't be provided by
         the vendor) just because the xtal frequency is different;
       - V4L DocBook: fix some typos at multi-plane formats description.
      
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        [media] xc5000: support 32MHz & 31.875MHz xtal using the 41.024.5 firmware
        [media] V4L: mt9m032: fix compilation breakage
        [media] V4L: DocBook: Fix typos in the multi-plane formats description
        [media] V4L: mt9m032: fix two dead-locks
        [media] rc-core: set mode for winbond-cir
        [media] drxk: Does not unlock mutex if sanity check failed in scu_command()
        [media] dvb_frontend: Fix a regression when switching back to DVB-S
      88981596
    • L
      Merge tag 'mfd-for-linus-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 · 9f24ff6f
      Linus Torvalds 提交于
      Pull MFD fixes from Samuel Ortiz:
       "We have 3 build fixes, a OMAP USB host PHY reset fix and the twl6040
        conversion to an i2c driver.  The latter may not sound like a fix but
        the twl6040 MFD driver won't probe without it, triggering an OMAP4
        audio regression."
      
      * tag 'mfd-for-linus-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
        mfd: Fix modular builds of rc5t583 regulator support
        mfd: Fix asic3_gpio_to_irq
        ARM: OMAP3: USB: Fix the EHCI ULPI PHY reset issue
        mfd: Convert twl6040 to i2c driver, and separate it from twl core
        mfd : Fix dbx500 compilation error
      9f24ff6f
  4. 21 4月, 2012 26 次提交