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 C2799C433E0 for ; Fri, 31 Jul 2020 20:59:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 88395208E4 for ; Fri, 31 Jul 2020 20:59:50 +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="UMB5h2mn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88395208E4 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 0AAE58D005B; Fri, 31 Jul 2020 16:59:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05C788D000B; Fri, 31 Jul 2020 16:59:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED9AE8D005B; Fri, 31 Jul 2020 16:59:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D91D58D000B for ; Fri, 31 Jul 2020 16:59:49 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 768B18248047 for ; Fri, 31 Jul 2020 20:59:49 +0000 (UTC) X-FDA: 77099587698.19.push15_570e94726f86 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 3B8DB1ACC29 for ; Fri, 31 Jul 2020 20:59:49 +0000 (UTC) X-HE-Tag: push15_570e94726f86 X-Filterd-Recvd-Size: 2831 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 20:59:48 +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=Lf6Tsl2/eoEgie5skYyJMNmAvL2Bjr4XRRNee/YKgpA=; b=UMB5h2mnjeZ1NU4HpmUnHmv/Rd HlcVYUzWJqeRgQ7GmNTDwJKdfVWRmyOvoj2S2q7zuz2PR6kN+5ozMq2Qxr5jP2ervyaxpMjTbw+75 5kfJUxiIIuEUqDIJ6DrYn3opeyfLlOEi40gxdA5EeSnbEjiTgPESdcm7Ppgakn9OsWgXRFCCOOSac dCwfMC7kRA/4TSef8vfpHayLwXM2/0VoUkRqT0y/aTraUF3glixnQNfDJCcC9YNvlAXFt08w4dPp+ bTGtp3vu7Y9sciW02YGMVX9zXrW21edap9a2j/v8WtT3Bj7jI+d0MpZ1GRbITZms9maEJidP5XhI5 qovR2ptw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1c7p-0002RM-4g; Fri, 31 Jul 2020 20:59:33 +0000 Date: Fri, 31 Jul 2020 21:59:33 +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: <20200731205933.GT23808@casper.infradead.org> References: <20200730231205.GA11265@paulmck-ThinkPad-P72> <20200731133834.517fdfee99b7ed2239f576aa@linux-foundation.org> <20200731204855.GR9247@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200731204855.GR9247@paulmck-ThinkPad-P72> X-Rspamd-Queue-Id: 3B8DB1ACC29 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 01:48:55PM -0700, Paul E. McKenney wrote: > On Fri, Jul 31, 2020 at 01:38:34PM -0700, Andrew Morton wrote: > > On Thu, 30 Jul 2020 16:12:05 -0700 "Paul E. McKenney" wrote: > > > > > So, may we add a GFP_ flag that will cause kmalloc() and friends to return > > > NULL when they would otherwise need to acquire their non-raw spinlock? > > > This avoids adding any overhead to the slab-allocator fastpaths, but > > > allows callback invocation to reduce cache misses without having to > > > restructure some existing callers of call_rcu() and potential future > > > callers of kfree_rcu(). > > > > We have eight free gfp_t bits so that isn't a problem. > > Whew!!! ;-) > > > Adding a test-n-branch to the kmalloc() fastpath may well be a concern. > > > > Which of mm/sl?b.c are affected? > > None of them, it turns out. The initial patch will instead directly > invoke __get_free_page(). So we could just leave sl?b.c alone. Isn't that spelled GFP_NOWAIT?