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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91124C433EF for ; Tue, 26 Oct 2021 10:24:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1B21D60187 for ; Tue, 26 Oct 2021 10:24:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1B21D60187 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 16722940008; Tue, 26 Oct 2021 06:24:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1171E940007; Tue, 26 Oct 2021 06:24:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2012940008; Tue, 26 Oct 2021 06:24:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id E182C940007 for ; Tue, 26 Oct 2021 06:24:49 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A1FA528DB9 for ; Tue, 26 Oct 2021 10:24:49 +0000 (UTC) X-FDA: 78738205098.01.20BC253 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf26.hostedemail.com (Postfix) with ESMTP id 0CB0A20019D7 for ; Tue, 26 Oct 2021 10:24:49 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CD5952195A; Tue, 26 Oct 2021 10:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635243887; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5+eIRKzH3SmEsZlFnQc8HV52kMGhR1HTYiW5mEjA988=; b=yEp0/YRULNKYJWtznx90xcD3YYi0wqCHvUDKBF4Qqb43L3/pD1KQ/crmld02JDcIwKfBT5 J64DG06FSUvP5KGzW7Y7gtlpCT0UjtqGfMHIC2qihF5AebrULHSsDbq5e3mg3X9NU6aoy2 EKDgej83W/WNEx/NILfiP6yrhqg3+pk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635243887; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5+eIRKzH3SmEsZlFnQc8HV52kMGhR1HTYiW5mEjA988=; b=5K/mPP0PtdH0o9ZHWQyuZqR/cdoKpM1SSIulQHBheQ1sQZnzcLxT0sWZJijPF/z8iht8sn UFLNDURNDXxnVyDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EB85B13D43; Tue, 26 Oct 2021 10:24:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gynmKWzXd2GkEwAAMHmgww (envelope-from ); Tue, 26 Oct 2021 10:24:44 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Michal Hocko" Cc: "Uladzislau Rezki" , "Linux Memory Management List" , "Dave Chinner" , "Andrew Morton" , "Christoph Hellwig" , linux-fsdevel@vger.kernel.org, "LKML" , "Ilya Dryomov" , "Jeff Layton" Subject: Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL In-reply-to: References: , , , <20211020192430.GA1861@pc638.lan>, <163481121586.17149.4002493290882319236@noble.neil.brown.name>, , <20211021104038.GA1932@pc638.lan>, <163485654850.17149.3604437537345538737@noble.neil.brown.name>, <20211025094841.GA1945@pc638.lan>, <163520582122.16092.9250045450947778926@noble.neil.brown.name>, Date: Tue, 26 Oct 2021 21:24:41 +1100 Message-id: <163524388152.8576.15706993879941541847@noble.neil.brown.name> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0CB0A20019D7 X-Stat-Signature: u9kmmeohhfwwqimun5n1yxr37rejykbs Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="yEp0/YRU"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="5K/mPP0P"; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf26.hostedemail.com: domain of neilb@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=neilb@suse.de X-HE-Tag: 1635243889-959530 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, 26 Oct 2021, Michal Hocko wrote: > On Tue 26-10-21 10:50:21, Neil Brown wrote: > > On Mon, 25 Oct 2021, Uladzislau Rezki wrote: > > > On Fri, Oct 22, 2021 at 09:49:08AM +1100, NeilBrown wrote: > > > > However I'm not 100% certain, and the behaviour might change in the > > > > future. So having one place (the definition of memalloc_retry_wait()) > > > > where we can change the sleeping behaviour if the alloc_page behavour > > > > changes, would be ideal. Maybe memalloc_retry_wait() could take a > > > > gfpflags arg. > > > > > > > At sleeping is required for __get_vm_area_node() because in case of lack > > > of vmap space it will end up in tight loop without sleeping what is > > > really bad. > > > > > So vmalloc() has two failure modes. alloc_page() failure and > > __alloc_vmap_area() failure. The caller cannot tell which... > > > > Actually, they can. If we pass __GFP_NOFAIL to vmalloc(), and it fails, > > then it must have been __alloc_vmap_area() which failed. > > What do we do in that case? > > Can we add a waitq which gets a wakeup when __purge_vmap_area_lazy() > > finishes? > > If we use the spinlock from that waitq in place of free_vmap_area_lock, > > then the wakeup would be nearly free if no-one was waiting, and worth > > while if someone was waiting. > > Is this really required to be part of the initial support? No.... I was just thinking out-loud. NeilBrown