Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2179ybk; Tue, 19 May 2020 13:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykUcVF1y1mZK1YWVm/W6e9lce8B3fqu/C8b99BIMaz3g73TiuW5tN/liEzWNelHFdDqD7e X-Received: by 2002:a17:906:1dcc:: with SMTP id v12mr1065129ejh.236.1589921516296; Tue, 19 May 2020 13:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589921516; cv=none; d=google.com; s=arc-20160816; b=I54C6GaBtYWqgnwBqqFgO0FGD4VRSZiNJQI+J0qfTxC5H2C/Icfx+Iq2Is4X9sGKXQ Hw8Ef1lYwYoIEtpR8N5a/Ak+HSpEQEGCDsTI1OqM8pNdPwUYWVKIOyJTeAT0wN5igLc/ LoRlevqIsO/wHZa9pPCjPsg574OLs2A+xB/0zc6ao1FXlUF8wZM63nPZcJ03KNTixI+e 6RqlWifPuzEYnI18cgRpu6lONV6Kpte2JlAojtggJADs2y684Qwxmm2K+Nv/ijVMIq55 mfh/xRzW9ecl98hvArjooU7KIi9IZjI7aaOwr6tX5H4sMEjaoyeQO0fMnglcpdKI2JPY SIog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=77K5NPu52Vg9lQmOBjp5ZLm4Q2SrSXrgX6ESTIlCYCM=; b=Mi46B8O2fqmv8fJwGnkdWGHFMGw2ICP9R/lK/zFBNFaz832GswwEK8tpLaBnfr0ykS VFm9PPYBgD5lzjpEGYC8lW5QGs5JIpXWFMxW17NgXfuQ4/BiukcBrUo4jRmxV1/cOExM HNyN66kAzhkobbnxrhxqngKEiFiVd5NkNymbZSzRF0h76CuE20tdZ0Vdm8DYCNQuXJxH 9uI45TD6Qy8mYvHLL5MLwUwMNzTLQUV+a/bOESyjgrW+oQ01kCpIoGgLww1YL5oIx0hG /BNvIOJX2Sbha7ae8PDeKlj8Y4W/40YpvZ4+BYYwasZuhxmakXfO4+oSNik2iu/wwFq7 nZmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=WlVctIWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx15si279090edb.320.2020.05.19.13.51.17; Tue, 19 May 2020 13:51:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=WlVctIWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726801AbgESUpx (ORCPT + 99 others); Tue, 19 May 2020 16:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgESUpx (ORCPT ); Tue, 19 May 2020 16:45:53 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BA7CC08C5C0; Tue, 19 May 2020 13:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=77K5NPu52Vg9lQmOBjp5ZLm4Q2SrSXrgX6ESTIlCYCM=; b=WlVctIWoU550mhHkvBOJ6k80nz TkxbLtxz2hPJ3GJJGjOuDTGGdR3bk2QoXCVldmRZDRU3lzyhlkICShCxBvX2l4n5A0NkMaucQMoDd rK2Z7kq8K/XANz8HCyFtozZNBjXFE3Eg1BV7OKaMVSU4FL2nMDjwl4fkyscX6AXu3ANbAZatNf69J mX8hoj2w+zTsBz0zQSgDFl+GCPY7PVdINTXl+xgd/0Mgrsg3kgGHSxAmU5dE+pY9X9WUPngI1GMNe Pe1otsKRsRb+QkRvu6VMyQ0q+6LtpG4RgZRpYzlB+YHNpnBn0z/CvyR/n5TtDcIs+GUUqMvvMRp3R mQggcnBQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jb97R-0004tv-QH; Tue, 19 May 2020 20:45:45 +0000 Date: Tue, 19 May 2020 13:45:45 -0700 From: Matthew Wilcox To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Steven Rostedt , Will Deacon , Thomas Gleixner , "Paul E . McKenney" , Linus Torvalds , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/8] radix-tree: Use local_lock for protection Message-ID: <20200519204545.GA16070@bombadil.infradead.org> References: <20200519201912.1564477-1-bigeasy@linutronix.de> <20200519201912.1564477-3-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519201912.1564477-3-bigeasy@linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 10:19:06PM +0200, Sebastian Andrzej Siewior wrote: > The radix-tree and idr preload mechanisms use preempt_disable() to protect > the complete operation between xxx_preload() and xxx_preload_end(). > > As the code inside the preempt disabled section acquires regular spinlocks, > which are converted to 'sleeping' spinlocks on a PREEMPT_RT kernel and > eventually calls into a memory allocator, this conflicts with the RT > semantics. > > Convert it to a local_lock which allows RT kernels to substitute them with > a real per CPU lock. On non RT kernels this maps to preempt_disable() as > before, but provides also lockdep coverage of the critical region. > No functional change. I don't seem to have a locallock.h in my tree. Where can I find more information about it? > +++ b/lib/radix-tree.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include /* in_interrupt() */ > #include > #include