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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 26E51C433E0 for ; Fri, 31 Jul 2020 22:47:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D7287208E4 for ; Fri, 31 Jul 2020 22:47:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FwJFBIEe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7287208E4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 58D248D0061; Fri, 31 Jul 2020 18:47:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53C5E8D000B; Fri, 31 Jul 2020 18:47:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 454B18D0061; Fri, 31 Jul 2020 18:47:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 306658D000B for ; Fri, 31 Jul 2020 18:47:54 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DA6EB181AEF0B for ; Fri, 31 Jul 2020 22:47:53 +0000 (UTC) X-FDA: 77099860026.15.arch65_000419526f87 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id A4B981802C539 for ; Fri, 31 Jul 2020 22:47:53 +0000 (UTC) X-HE-Tag: arch65_000419526f87 X-Filterd-Recvd-Size: 2826 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 22:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=jo5zynVx6cBLfbI9yKog9Ac2IbuetzghuOBuscp79bQ=; b=FwJFBIEeg6oRwAvzEd7NnfgAYr sKIunvYAAhIk8aU16uUzyrxqkCttsBx44PLhKik97IFwVdPJwk2r4Jcb2O1FEAWk0VHYrWRvY+Zjd Q/50Sb31BS3i9h6v6KovOKtFUoPmeIbkxDyhUNehC9DLA32hMXswPmLQp//KzclfyIfyjcrSB3j8h stGyRR1O7ldZMG6CzPhqaK5DoI93ng3+KEMWG2QtI6FY0bw0ne7ur+5rO91VvlJzsQ6Y8y5tu77Zc veJGamWaTFkcCAVT99bywCfFssgWVkKTKd580mk0e4IO+BxhmDl8sRX92G/RY8D0m+NEXXiSTbox0 n/nGvIhQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1doQ-0007x7-GA; Fri, 31 Jul 2020 22:47:38 +0000 Date: Fri, 31 Jul 2020 23:47:38 +0100 From: Matthew Wilcox To: "Paul E. McKenney" 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: <20200731224738.GU23808@casper.infradead.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200731223016.GT9247@paulmck-ThinkPad-P72> X-Rspamd-Queue-Id: A4B981802C539 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 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.