Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp425337iob; Tue, 3 May 2022 22:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5kPJSNjIVi02ZhenofqWUtKpQufH2ieafx9lcMWw1d1qEoPtIisNo3BTRUBgabdiq/zUg X-Received: by 2002:aa7:c54d:0:b0:425:d8c9:efc6 with SMTP id s13-20020aa7c54d000000b00425d8c9efc6mr21138193edr.48.1651643047850; Tue, 03 May 2022 22:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651643047; cv=none; d=google.com; s=arc-20160816; b=piW4Uzjsepm9T6JzHnc29QVESQYxyZ6lR2jcTkiUo84+Lm8VMzs13jW7xgJZyUkT5A +XKROlGd0oTESX9o8fYBN7wo+ihBN8UohJaBbLvia9NfToPG6l8pgGOnWUyOZNKf/Gvo 9q5MPbCr8P9ZPZjWgX+l45Fr3qbbFHEKOpIjRSI/73ugNx+3hDFwkzF2YYHSOxDCy/1i sXXff48ejoYlI1JdNc+YP75DnT4YU2rjTKJnxFJ8J2dYGAtAD0plFa9TTKGa/3ANIXQG KkivTlVLbxLlYIUvadXJqtLHn50MMzj69kcecwK7pDZoMxWoYSB48t3bKWitpN5KPpzG D1uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mkiLTHX9DkdCmqXMktL1iZTuHY0Fqqp8LKysa1EnFFs=; b=KSD851S/KS07Y5JDRTAbsGwgL6xkVP2NX7u95VmDauPfKIkMLEP8LydjbdoMQiLcXV uMkTir2QS+6RvAIS/priXMdtBqNYf92E74Ux2T5W6E2m7TX15rys3HVuL/18vIrJKTvt IT6Wu26eyxb6etya0GyYsRR//KPAysNpDU0lXq6h1rYWaK6ZR6f/vj0j93g7eCF/uMGj FomAWS1Z3CgMu8r+oA2YJXbX1cLKE7sl9aCMwxtS93B0py73kQ7dlaorTCh+GDxQjffq f3DXaf3TivgkhGunEvikM4WbigUg7INxv1cZrFJk2Z0SB2+zeLYUpFggXxNQoylweuQT orkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ld62q2Be; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a17090627d200b006f3845f95f1si1141015ejc.621.2022.05.03.22.43.44; Tue, 03 May 2022 22:44:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ld62q2Be; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239093AbiECQmr (ORCPT + 99 others); Tue, 3 May 2022 12:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239632AbiECQmp (ORCPT ); Tue, 3 May 2022 12:42:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A86727CEF for ; Tue, 3 May 2022 09:39:12 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id C5C956174C for ; Tue, 3 May 2022 16:39:11 +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-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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