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 EB0B7C433E1 for ; Sat, 15 Aug 2020 14:23:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A29EF207CD for ; Sat, 15 Aug 2020 14:23:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="bjsTDAf6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A29EF207CD 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 28F576B0002; Sat, 15 Aug 2020 10:23:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 240A86B0005; Sat, 15 Aug 2020 10:23:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1580E6B0006; Sat, 15 Aug 2020 10:23:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id F3F866B0002 for ; Sat, 15 Aug 2020 10:23:27 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8B88040C7 for ; Sat, 15 Aug 2020 14:23:27 +0000 (UTC) X-FDA: 77153020854.02.soup87_20007dd27006 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 5332610097AA1 for ; Sat, 15 Aug 2020 14:23:27 +0000 (UTC) X-HE-Tag: soup87_20007dd27006 X-Filterd-Recvd-Size: 3830 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Sat, 15 Aug 2020 14:23:26 +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 EC3E520729; Sat, 15 Aug 2020 14:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597501406; bh=ADnDcxQp2V8HOw/PuJLE5kvRQJ9cpSo0bvw+VQMcP6Y=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=bjsTDAf6Fj18zDffLso3bADg2dt4QoLnH7wH3gCWaTfuSBwkcIu13zPUv+Mjj/xGO +uEPtedw9Btk8lR0TnIvXHphtmK+xjkekv582H+gxEGzLfjT7UkpadFVoyeBbPRnji uf1JvTGripiLbmcipsYfcsYGUWdmXLDSgcVzDeZg= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id CDE6035230C2; Sat, 15 Aug 2020 07:23:25 -0700 (PDT) Date: Sat, 15 Aug 2020 07:23:25 -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: <20200815142325.GA32640@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> <20200815141839.GA4295@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200815141839.GA4295@paulmck-ThinkPad-P72> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 5332610097AA1 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 Sat, Aug 15, 2020 at 07:18:39AM -0700, Paul E. McKenney wrote: > 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; Right, too early in the morning. :-/ This "slight" variation might include a bit of usefulness along with the convincing: if (IS_ENABLED(CONFIG_PROVE_LOCKING) && !(prandom_u32() & 0xff)) return NULL; Plus failing one out of 256 times is likely a better choice than once out of 65536 times, especially for the occasional caller of this function. Thanx, Paul > 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