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=-4.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 58DEDC433E0 for ; Fri, 31 Jul 2020 20:38:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D76B22B3F for ; Fri, 31 Jul 2020 20:38:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="lUcEV892" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D76B22B3F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9DB978D0058; Fri, 31 Jul 2020 16:38:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 964558D000B; Fri, 31 Jul 2020 16:38:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 82E308D0058; Fri, 31 Jul 2020 16:38:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id 683458D000B for ; Fri, 31 Jul 2020 16:38:37 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 19497181AEF0B for ; Fri, 31 Jul 2020 20:38:37 +0000 (UTC) X-FDA: 77099534274.13.coil22_2e0ca4526f86 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id D9E9B18140B60 for ; Fri, 31 Jul 2020 20:38:36 +0000 (UTC) X-HE-Tag: coil22_2e0ca4526f86 X-Filterd-Recvd-Size: 2318 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 20:38:36 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A64D21744; Fri, 31 Jul 2020 20:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596227915; bh=UiAvZEfW3ClxCu672wov0jKI+ccwVPoNvJXKh0xHAJo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lUcEV892FuJYWdVHY3viR2kP5fT2UK8Ok7pZf/aOtcjX3Q8Zrah2XJKol5BQvNAv1 LwOj1KJ0/MPNsKDfSMxuEXql/HeNFCOF43vAa7L5HZOQn5a9ShHvC9omyWTbpX+XQl +u/k6UkMv7PkY0+ebx24Y4uZh6N+nW0WLI6U4Ijg= Date: Fri, 31 Jul 2020 13:38:34 -0700 From: Andrew Morton To: paulmck@kernel.org Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, hannes@cmpxchg.org, willy@infradead.org, urezki@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: Raw spinlocks and memory allocation Message-Id: <20200731133834.517fdfee99b7ed2239f576aa@linux-foundation.org> In-Reply-To: <20200730231205.GA11265@paulmck-ThinkPad-P72> References: <20200730231205.GA11265@paulmck-ThinkPad-P72> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D9E9B18140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 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. Adding a test-n-branch to the kmalloc() fastpath may well be a concern. Which of mm/sl?b.c are affected? A doesnt-need-to-really-work protopatch would help us understand the potential cost?