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 EDCFDC433F5 for ; Tue, 26 Oct 2021 07:17:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 86A2861073 for ; Tue, 26 Oct 2021 07:17:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 86A2861073 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1EA2380007; Tue, 26 Oct 2021 03:17:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 19933940007; Tue, 26 Oct 2021 03:17:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0615880007; Tue, 26 Oct 2021 03:17:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id EC155940007 for ; Tue, 26 Oct 2021 03:17:00 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A7FCC2D019 for ; Tue, 26 Oct 2021 07:17:00 +0000 (UTC) X-FDA: 78737731800.04.B1A863E Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf17.hostedemail.com (Postfix) with ESMTP id 4CB32F000392 for ; Tue, 26 Oct 2021 07:17:00 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 1E4C71F770; Tue, 26 Oct 2021 07:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1635232619; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EfZ134/uZ+lGhJW8rE30an18ctrr3KRMnpEcmnbtvg4=; b=jvGN7I5NEwtF3c2TalafkUNm8rG8IjySDu/jAz6T2ecydsgCY+ftnP+l2/0wPsMNfCsbJt gW63oRc80Qw0DVmMm3OkvZQDWS9ZPIhI3hx19ZounPaY0tUxGCxGvXMZNPIOvG6ZqHB6Ns PWSd4xGbjsRRI/1Qv4FqoXVnBce2cy0= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E0F28A3B83; Tue, 26 Oct 2021 07:16:58 +0000 (UTC) Date: Tue, 26 Oct 2021 09:16:57 +0200 From: Michal Hocko To: NeilBrown 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 Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163520582122.16092.9250045450947778926@noble.neil.brown.name> X-Stat-Signature: 51wki65cyyou36du7iiyei66hwsgzo1i X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4CB32F000392 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=jvGN7I5N; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf17.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1635232620-142416 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-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? -- Michal Hocko SUSE Labs