From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F14DBC43215 for ; Fri, 15 Nov 2019 14:56:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D569A2053B for ; Fri, 15 Nov 2019 14:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727743AbfKOO4l (ORCPT ); Fri, 15 Nov 2019 09:56:41 -0500 Received: from mx2.suse.de ([195.135.220.15]:40462 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727526AbfKOO4l (ORCPT ); Fri, 15 Nov 2019 09:56:41 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3CBA7B15E; Fri, 15 Nov 2019 14:56:39 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 3ABBE1E4407; Fri, 15 Nov 2019 15:56:38 +0100 (CET) Date: Fri, 15 Nov 2019 15:56:38 +0100 From: Jan Kara To: Sebastian Siewior Cc: Thomas Gleixner , Matthew Wilcox , LKML , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Anna-Maria Gleixner , Steven Rostedt , Julia Cartwright , Jan Kara , Theodore Tso , Alexander Viro , Jan Kara , Mark Fasheh , Joseph Qi , Christoph Hellwig , Joel Becker Subject: Re: [PATCH] fs/buffer: Make BH_Uptodate_Lock bit_spin_lock a regular spinlock_t Message-ID: <20191115145638.GA5461@quack2.suse.cz> References: <20190820170818.oldsdoumzashhcgh@linutronix.de> <20190820171721.GA4949@bombadil.infradead.org> <20191011112525.7dksg6ixb5c3hxn5@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191011112525.7dksg6ixb5c3hxn5@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 > > > > [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 SUSE Labs, CR