lkml.org 
[lkml]   [2011]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] VFS: br_write_lock locks on possible CPUs other than online CPUs
    From
    Date
    On Mon, 2011-12-19 at 16:00 +1100, Dave Chinner wrote:
    > On Mon, Dec 19, 2011 at 04:11:42AM +0000, Al Viro wrote:
    > > On Mon, Dec 19, 2011 at 11:36:15AM +0800, mengcong wrote:
    > > > In a heavily loaded system, when frequently turning on and off CPUs, the
    > > > kernel will detect soft-lockups on multiple CPUs. The detailed bug report
    > > > is at https://lkml.org/lkml/2011/8/24/185.
    > > >
    > > > The root cause is that brlock functions, i.e. br_write_lock() and
    > > > br_write_unlock(), only locks/unlocks the per-CPU spinlock of CPUs that
    > > > are online, which means, if one online CPU is locked and then goes
    > > > offline, any later unlocking operation happens during its offline state
    > > > will not touch it; and when it goes online again, it has the incorrect
    > > > brlock state. This has been verified in current kernel.
    > > >
    > > > I can reproduce this bug on the intact 3.1 kernel. After my patch applied,
    > > > I've ran an 8-hours long test(test script provided by the bug reporter),
    > > > and no soft lockup happened again.
    > >
    > > Argh... OK, that's seriously nasty. I agree that this is broken, but
    > > your patch makes br_write_lock() very costly on kernels build with
    > > huge number of possible CPUs, even when it's run on a box with few
    > > CPUs ;-/
    >
    > I fixed this problem with the XFS per-cpu superblock counters
    > (bit lock + counters in per-cpu structs) back in 2006. It basically
    > uses a lglock-like local/global locking structure and iterates them
    > using for_each_online_cpu().
    >
    > I fixed it simply by registering a hotplug notifier and
    > draining/reinitialising counters on the appropriate event under a
    > global lock context. i.e. make CPU hotplug serialise against
    > concurrent lock operations. See commit e8234a68 ("[XFS] Add support
    > for hotplug CPUs...")
    >

    how about to register a cpu hotplug notifier to align the brlock as what
    Dave did?

    > Cheers,
    >
    > Dave.




    \
     
     \ /
      Last update: 2011-12-19 07:11    [W:0.026 / U:0.160 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site