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.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 8E7AFC433DF for ; Sat, 1 Aug 2020 00:03:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D0B820829 for ; Sat, 1 Aug 2020 00:03:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="SclFVmF6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D0B820829 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C4C8A8D0064; Fri, 31 Jul 2020 20:03:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFE068D000B; Fri, 31 Jul 2020 20:03:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B132C8D0064; Fri, 31 Jul 2020 20:03:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) by kanga.kvack.org (Postfix) with ESMTP id 998508D000B for ; Fri, 31 Jul 2020 20:03:47 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DA26E180301AF for ; Sat, 1 Aug 2020 00:03:46 +0000 (UTC) X-FDA: 77100051252.06.horse23_201486026f88 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id BF66010039A57 for ; Sat, 1 Aug 2020 00:02:25 +0000 (UTC) X-HE-Tag: horse23_201486026f88 X-Filterd-Recvd-Size: 3039 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Sat, 1 Aug 2020 00:02:24 +0000 (UTC) Received: from paulmck-ThinkPad-P72.home (unknown [50.45.173.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CB3220829; Sat, 1 Aug 2020 00:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596240144; bh=FmJf7TKhZ0SY0RT8nOtjrcPtXG+DZtBAQCKHkKvCS/8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=SclFVmF6cOdvuJYu4J/78FXHrEPMxX8okyPbCEJ7xKGSsynvXF679O/91szQQVrjf lXbVA05XabjXLlEOn/SYw9jQRLpk6u22DB0xUzG7Fe0xaqvpYaLC68HQtuFrNJ1eOn qlB8Tg/J22afywvUBFzB+JYYcg5yjWnfx3cagq3Y= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id D18C73522625; Fri, 31 Jul 2020 17:02:23 -0700 (PDT) Date: Fri, 31 Jul 2020 17:02:23 -0700 From: "Paul E. McKenney" To: Matthew Wilcox Cc: Andrew Morton , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, hannes@cmpxchg.org, urezki@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: Raw spinlocks and memory allocation Message-ID: <20200801000223.GU9247@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200730231205.GA11265@paulmck-ThinkPad-P72> <20200731133834.517fdfee99b7ed2239f576aa@linux-foundation.org> <20200731204855.GR9247@paulmck-ThinkPad-P72> <20200731205933.GT23808@casper.infradead.org> <20200731212457.GS9247@paulmck-ThinkPad-P72> <20200731142919.36c4c741189426db0f8b8514@linux-foundation.org> <20200731223016.GT9247@paulmck-ThinkPad-P72> <20200731224738.GU23808@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200731224738.GU23808@casper.infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: BF66010039A57 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 31, 2020 at 11:47:38PM +0100, Matthew Wilcox wrote: > On Fri, Jul 31, 2020 at 03:30:16PM -0700, Paul E. McKenney wrote: > > On Fri, Jul 31, 2020 at 02:29:19PM -0700, Andrew Morton wrote: > > > On Fri, 31 Jul 2020 14:24:57 -0700 "Paul E. McKenney" wrote: > > > > > > > The reason for this restriction is that in -rt, the spin_lock(&zone->lock) > > > > in rmqueue_bulk() can sleep. > > > > > > So if there is runtime overhead, this overhead could be restricted to > > > -rt kernels with suitable ifdefs? > > > > In theory, yes. In practice, with CONFIG_PROVE_RAW_LOCK_NESTING=y, > > lockdep will complain regardless of -rt or not. > > On non-RT, we could make that lock a raw spinlock. On RT, we could > decline to take the lock. We'd need to abstract the spin_lock() away > behind zone_lock(zone), but that should be OK. > > But let's see if we need to do that. Fair enough! Thanx, Paul