lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170216110618.GC6557@twins.programming.kicks-ass.net>
Date:   Thu, 16 Feb 2017 12:06:18 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Mike Galbraith <efault@....de>,
        RT <linux-rt-users@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [RT] lockdep munching nr_list_entries like popcorn

On Thu, Feb 16, 2017 at 10:01:18AM +0100, Thomas Gleixner wrote:
> On Thu, 16 Feb 2017, Mike Galbraith wrote:
> 
> > On Thu, 2017-02-16 at 09:37 +0100, Thomas Gleixner wrote:
> > > On Thu, 16 Feb 2017, Mike Galbraith wrote:
> > > 
> > ...
> > > > swapvec_lock?  Oodles of 'em?  Nope.
> > > 
> > > Well, it's a per cpu lock and the lru_cache_add() variants might be called
> > > from a gazillion of different call chains, but yes, it does not make a lot
> > > of sense. We'll have a look.
> > 
> > Adding explicit local_irq_lock_init() makes things heaps better, so
> > presumably we need better lockdep-foo in DEFINE_LOCAL_IRQ_LOCK().
> 
> Bah.


#ifdef CONFIG_DEBUG_LOCK_ALLOC
#define PER_CPU_DEP_MAP_INIT(lockname)                          \
        .dep_map = {                                            \
                .key = ({ static struct lock_class_key __key; &__key }), \
                .name = #lockname,                              \
        }
#else
#define PER_CPU_DEP_MAP_INIT(lockname)
#endif

#define DEFINE_LOCAL_IRQ_LOCK(lvar)                             \
        DEFINE_PER_CPU(struct local_irq_lock, lvar) = {         \
                .lock = { .rlock = {                            \
                        .raw_lock = __ARCH_SPIN_LOCK_UNLOCKED,  \
                        SPIN_DEBUG_INIT(lvar)                   \
                        PER_CPU_DEP_MAP_INIT(lvar)              \
                } }                                             \
        }

That's fairly horrible for poking inside all the internals, but it might
just work ;-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ