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 5EAE7C433FE for ; Mon, 25 Oct 2021 23:50:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EFDB061076 for ; Mon, 25 Oct 2021 23:50:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EFDB061076 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 7AAF98000C; Mon, 25 Oct 2021 19:50:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75AE2940007; Mon, 25 Oct 2021 19:50:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 621288000C; Mon, 25 Oct 2021 19:50:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id 51320940007 for ; Mon, 25 Oct 2021 19:50:29 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 10AAA8249980 for ; Mon, 25 Oct 2021 23:50:29 +0000 (UTC) X-FDA: 78736606578.05.0D4EC4D Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf02.hostedemail.com (Postfix) with ESMTP id 2A7477001A08 for ; Mon, 25 Oct 2021 23:50:25 +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-out2.suse.de (Postfix) with ESMTPS id 42BA11F770; Mon, 25 Oct 2021 23:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635205827; 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=xJHXZbi24TJIP9vr7waWGzuy6gde4hlefZz+RK4iT4g=; b=QvziNNgB6DAnCN8N64t5ZaTCaLDfH+ssRBUsc6QxmtfQDUZGGC3xa1tol41sETg84sfl44 cx40ZZl5Nc7Y8+rttb364KQ9Daj0ByLJr3pXf1AqHuCc6SZKn60I9XSMCN4UxVynFt8MIV Sqn2aLDtcDgVQf615shiu3KYIH4/hEI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635205827; 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=xJHXZbi24TJIP9vr7waWGzuy6gde4hlefZz+RK4iT4g=; b=KakUYe7ecaoyJllSZbfMkAV414oqnxqvSRzgbHkdrUGlEo1FiAGtctnJUIICBmUb9m3KYx s/Q2ggYtv7lh2+AQ== 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 5944713CBD; Mon, 25 Oct 2021 23:50:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LrO2BcBCd2EbVQAAMHmgww (envelope-from ); Mon, 25 Oct 2021 23:50:24 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Uladzislau Rezki" Cc: "Michal Hocko" , "Uladzislau Rezki" , "Michal Hocko" , "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: <20211025094841.GA1945@pc638.lan> 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> Date: Tue, 26 Oct 2021 10:50:21 +1100 Message-id: <163520582122.16092.9250045450947778926@noble.neil.brown.name> X-Stat-Signature: po3zdix5gq1cej1wk1zor9d6ry95n4u6 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=QvziNNgB; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=KakUYe7e; spf=pass (imf02.hostedemail.com: domain of neilb@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=neilb@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2A7477001A08 X-HE-Tag: 1635205825-515445 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 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. Thanks, NeilBrown