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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9F53C4332F for ; Tue, 3 May 2022 16:39:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02B656B00A1; Tue, 3 May 2022 12:39:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1BF56B00A3; Tue, 3 May 2022 12:39:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE3296B00A4; Tue, 3 May 2022 12:39:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id CF8566B00A1 for ; Tue, 3 May 2022 12:39:14 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9E00420574 for ; Tue, 3 May 2022 16:39:14 +0000 (UTC) X-FDA: 79424991828.27.C45C59B Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf27.hostedemail.com (Postfix) with ESMTP id 4685540078 for ; Tue, 3 May 2022 16:39:12 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 62CB5B81D9D; Tue, 3 May 2022 16:39:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16FB4C385AF; Tue, 3 May 2022 16:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651595951; bh=KL8s36Mxf7cX9xP0GXX7OyVZdqJjzw/ipLa9/teybm8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=ld62q2Benx4MXZOvgoVjaD1Hyur/pUhd5YJPyjLhI0ia9tuluGrhPHfgm/yuq2Nhd DVhVKdhhJXl/EnqN8kycC0qaqy9wvWp8gcE7tctfAhbGFR/bc22I7Y7keg0hDUHQVN w7G+faneXSlVrrZOgfPvGfXu0SHUFUS/lmDUmutdut9QYAJ0NmXlcuXgSYwZySWifV /ZCQI8vGipp3ve/0pQSqzCn0tsPkYd7dBIYPgQ20rzk1Zf4han7TTfQV5SyZ+7kyin tZ74cybFyGA+7a34Q8j8DRnZ6hU4YTgVxsiBVkn0bAp5bmCyKos7N0D8I5S7EuqiBC BR/EYfZDUR+5A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A45105C0115; Tue, 3 May 2022 09:39:05 -0700 (PDT) Date: Tue, 3 May 2022 09:39:05 -0700 From: "Paul E. McKenney" To: Michal Hocko Cc: liam.howlett@oracle.com, willy@infradead.org, walken.cr@gmail.com, hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: Memory allocation on speculative fastpaths Message-ID: <20220503163905.GM1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220503155913.GA1187610@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: mutbd1r9xg5xqb3d5fqscjis74zb19mu X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 4685540078 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ld62q2Be; spf=pass (imf27.hostedemail.com: domain of "SRS0=eDkt=VL=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=eDkt=VL=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org"; dmarc=pass (policy=none) header.from=kernel.org X-Rspam-User: X-HE-Tag: 1651595952-116173 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 Tue, May 03, 2022 at 06:04:13PM +0200, Michal Hocko wrote: > On Tue 03-05-22 08:59:13, Paul E. McKenney wrote: > > Hello! > > > > Just following up from off-list discussions yesterday. > > > > The requirements to allocate on an RCU-protected speculative fastpath > > seem to be as follows: > > > > 1. Never sleep. > > 2. Never reclaim. > > 3. Leave emergency pools alone. > > > > Any others? > > > > If those rules suffice, and if my understanding of the GFP flags is > > correct (ha!!!), then the following GFP flags should cover this: > > > > __GFP_NOMEMALLOC | __GFP_NOWARN > > GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN Ah, good point on GFP_NOWAIT, thank you! > > Or is this just a fancy way of always returning NULL or some such? ;-) > > It could fail quite easily. We would also want to guarantee (by > documenting I guess) that the page allocator never does anything that > would depend or invoke rcu_synchronize or something like that. The GPF_NOWAIT should rule out synchronize_rcu() and similar, correct? > I believe this is the case currently. Here is hoping! ;-) Thanx, Paul