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 C7917C433EF for ; Tue, 3 May 2022 16:04:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 581886B009C; Tue, 3 May 2022 12:04:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 530B46B009D; Tue, 3 May 2022 12:04:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41FCF6B009E; Tue, 3 May 2022 12:04:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 33C8B6B009C for ; Tue, 3 May 2022 12:04:19 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 070991208EE for ; Tue, 3 May 2022 16:04:19 +0000 (UTC) X-FDA: 79424903838.06.58E8CBD Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf11.hostedemail.com (Postfix) with ESMTP id 93AA14007B for ; Tue, 3 May 2022 16:04:14 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id B23861F74D; Tue, 3 May 2022 16:04:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1651593856; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gg2obvCP4uGseNM46DcVy8f8HF/W6yCP38YvJGSTCWY=; b=WXl7GwcbpZMOrdvBuHPm05ZIolsnfWDVcyxt2pJJi0NW3TbhVom0xDX1WuJcSWvlq7cthf HuG8d5ra9EZ6ufcEt75ipkmTdfbDXvguUtiKRCMACmKu2b/d7XPJpKtX09Cmxt/tKazh8q 0ucBzIOCAnyRPUM0uDZsr6B1ghqIOZk= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id DAB3B2C145; Tue, 3 May 2022 16:04:15 +0000 (UTC) Date: Tue, 3 May 2022 18:04:13 +0200 From: Michal Hocko To: "Paul E. McKenney" 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: 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: <20220503155913.GA1187610@paulmck-ThinkPad-P17-Gen-1> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 93AA14007B X-Stat-Signature: 7uscrhr38mh5hxnmbqf3w7ucrm9gqqyc X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=WXl7Gwcb; spf=pass (imf11.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-HE-Tag: 1651593854-503168 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 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 > 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. I believe this is the case currently. -- Michal Hocko SUSE Labs