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  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]
Date:   Fri, 15 Nov 2019 15:56:38 +0100
From:   Jan Kara <jack@...e.cz>
To:     Sebastian Siewior <bigeasy@...utronix.de>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Matthew Wilcox <willy@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Anna-Maria Gleixner <anna-maria@...utronix.de>,
        Steven Rostedt <rostedt@...dmis.org>,
        Julia Cartwright <julia@...com>, Jan Kara <jack@...e.cz>,
        Theodore Tso <tytso@....edu>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Jan Kara <jack@...e.com>, Mark Fasheh <mark@...heh.com>,
        Joseph Qi <joseph.qi@...ux.alibaba.com>,
        Christoph Hellwig <hch@...radead.org>,
        Joel Becker <jlbec@...lplan.org>
Subject: Re: [PATCH] fs/buffer: Make BH_Uptodate_Lock bit_spin_lock a regular
 spinlock_t

On Fri 11-10-19 13:25:25, Sebastian Siewior wrote:
> On 2019-08-20 20:01:14 [+0200], Thomas Gleixner wrote:
> > On Tue, 20 Aug 2019, Matthew Wilcox wrote:
> > > On Tue, Aug 20, 2019 at 07:08:18PM +0200, Sebastian Siewior wrote:
> > > > Bit spinlocks are problematic if PREEMPT_RT is enabled, because they
> > > > disable preemption, which is undesired for latency reasons and breaks when
> > > > regular spinlocks are taken within the bit_spinlock locked region because
> > > > regular spinlocks are converted to 'sleeping spinlocks' on RT. So RT
> > > > replaces the bit spinlocks with regular spinlocks to avoid this problem.
> > > > Bit spinlocks are also not covered by lock debugging, e.g. lockdep.
> > > > 
> > > > Substitute the BH_Uptodate_Lock bit spinlock with a regular spinlock.
> > > > 
> > > > Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> > > > [bigeasy: remove the wrapper and use always spinlock_t]
> > > 
> > > Uhh ... always grow the buffer_head, even for non-PREEMPT_RT?  Why?
> > 
> > Christoph requested that:
> > 
> >   https://lkml.kernel.org/r/20190802075612.GA20962@infradead.org
> 
> What do we do about this one?

I was thinking about this for quite some time. In the end I think the patch
is almost fine but I'd name the lock b_update_lock and put it just after
b_size element in struct buffer_head to use the hole there. That way we
don't grow struct buffer_head.

With some effort, we could even shrink struct buffer_head from 104 bytes
(on x86_64) to 96 bytes but I don't think that effort is worth it (I'd find
it better use of time to actually work on getting rid of buffer heads
completely).

								Honza

-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists