Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp840920pxb; Mon, 25 Oct 2021 20:19:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhdhN2ZNyllKD8jLWOlZuzr7/qHpo/ph7qBs2Awdij2WlbGRNUROIjU/JYz/FW8fnmzuB3 X-Received: by 2002:a17:906:9b53:: with SMTP id ep19mr28205208ejc.66.1635218348477; Mon, 25 Oct 2021 20:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635218348; cv=none; d=google.com; s=arc-20160816; b=HO5D5KTlH49XSmsa1+CoEQrEZm/z3XXj7/FaZ6m3p4id39uSiuBOTj0zxOOtK8kI00 y0MSl/1Xm7HlpPpO5HFMFtZwaziLV6HagEd6+rQ8ec6Y4Zz85cqP0NkWK2b2s9+rM9Z4 PObDxaLv/kPOI1eXgCwI55+tnGaYrbVikqOm/Kfy0WLc/+NVtrKYOCGGZKo/2zE76ILM LgHjFTGmRL/xvqVUQyRz3diynUJzZxP8aX+eOGEojAigeO5kPwQcYWtc2KkQTvoXleee /7gOCC1t9P9fdyPsk4RmgurYIj83D9kkGe8/EDTlcq1ayhzC2SgiCSs1kTQIko+X3hUO PL6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=xJHXZbi24TJIP9vr7waWGzuy6gde4hlefZz+RK4iT4g=; b=hWg/n1vJTevQID6MF9m4XskxOW8ShGDJ7431jli7JqEMExcJANiW1Zio0BaaSaGu6y qsL0DR49HBwB6ir0HNEtAlpJpomtnjefCVhwO6DgJZdhzPAXEGWmmWRY5ZaLtKfiTHBc IBUjWeN4V6rE0GqdLQpikXpqDadDsbyxJwBHZdrDy6dTqIE7a/DHT3rhT+fiubGAaR+5 6ILuM/g7pzo4aPu6nQH3RhsZEJ1sIla4hBcaadkY94iT7nAqVSCouVaB64wXy3xJxVa0 d5C8WPbL+CFP2u7ms1e8sDQ6X+SRsPQ6zh3ljCpZ1CTpKOXrx3+mn8gpN+T21sFUXnDJ w+yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=QvziNNgB; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=KakUYe7e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si30414683edu.126.2021.10.25.20.18.44; Mon, 25 Oct 2021 20:19:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=QvziNNgB; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=KakUYe7e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235321AbhJYXwv (ORCPT + 99 others); Mon, 25 Oct 2021 19:52:51 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:49202 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbhJYXwv (ORCPT ); Mon, 25 Oct 2021 19:52:51 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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