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=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 19A30C433DF for ; Sat, 15 Aug 2020 14:18:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB03E23135 for ; Sat, 15 Aug 2020 14:18:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="W/A1xzjE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB03E23135 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 094D46B0002; Sat, 15 Aug 2020 10:18:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 045F26B0005; Sat, 15 Aug 2020 10:18:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E76816B0006; Sat, 15 Aug 2020 10:18:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id CF03C6B0002 for ; Sat, 15 Aug 2020 10:18:41 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 881A18248068 for ; Sat, 15 Aug 2020 14:18:41 +0000 (UTC) X-FDA: 77153008842.06.air10_1d0cf9627006 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 57CC4100404F2 for ; Sat, 15 Aug 2020 14:18:41 +0000 (UTC) X-HE-Tag: air10_1d0cf9627006 X-Filterd-Recvd-Size: 3283 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Sat, 15 Aug 2020 14:18:40 +0000 (UTC) Received: from paulmck-ThinkPad-P72.home (unknown [50.45.173.55]) (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 E246D23121; Sat, 15 Aug 2020 14:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597501119; bh=gOLVKJhS/tWnZd7SI7/SoAPUz7KoYASG6xnNwS+qeCE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=W/A1xzjEeU0SpXkwJq9Jh98nKdANsl/Uu2mJB/MVs0Q5XIy6rxxheuXxW214d0EQs L0fdc/Sy2K/UVPx2xKI0PNqhuD5LcXuUHHhNG43bK+H0ZqulQKAAIoDNYNsWs9hjSF rd2fJocg9nXrLneCwKwNcjHbLnX3xLm4zG2P80RQ= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id C045F35230C2; Sat, 15 Aug 2020 07:18:39 -0700 (PDT) Date: Sat, 15 Aug 2020 07:18:39 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Thomas Gleixner , Michal Hocko , Uladzislau Rezki , LKML , RCU , linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Matthew Wilcox , "Theodore Y . Ts'o" , Joel Fernandes , Sebastian Andrzej Siewior , Oleksiy Avramchenko Subject: Re: [RFC-PATCH 1/2] mm: Add __GFP_NO_LOCKS flag Message-ID: <20200815141839.GA4295@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200814180141.GP4295@paulmck-ThinkPad-P72> <87tux4kefm.fsf@nanos.tec.linutronix.de> <20200815084250.GN3982@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200815084250.GN3982@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 57CC4100404F2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Sat, Aug 15, 2020 at 10:42:50AM +0200, Peter Zijlstra wrote: > On Sat, Aug 15, 2020 at 01:14:53AM +0200, Thomas Gleixner wrote: > > > #1 trivial fix is to force switching to an high prio thread or a soft > > interrupt which does the allocation > > Yeah, push the alocation out to another context. I did consider it, but > why bother? > > Also, raising a softirq can't be done from every context, that's a whole > new problem. You can do irq_work I suppose, but not all architectures > support the self-IPI yet. > > All in all, it's just more complexity than the fairly trivial > __alloc_page_lockless(). > > Whichever way around, we can't rely on the allocation. One way to enforce that would be to put something like this at the beginning of the __alloc_page_lockless() function: if (IS_ENABLED(CONFIG_PROVE_LOCKING) && (prandom_u32() & 0xffff)) return NULL; I am sure that there is a better choice than CONFIG_PROVE_LOCKING. But whatever the choice, there is nothing quite like the occasional allocation failure during testing to convince people that such failure really can happen. Thanx, Paul