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 44111C433F5 for ; Fri, 22 Oct 2021 08:18:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF82D60FD8 for ; Fri, 22 Oct 2021 08:18:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DF82D60FD8 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 808A1900003; Fri, 22 Oct 2021 04:18:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BA45900002; Fri, 22 Oct 2021 04:18:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A710900003; Fri, 22 Oct 2021 04:18:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 5AF98900002 for ; Fri, 22 Oct 2021 04:18:44 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 182BC8249980 for ; Fri, 22 Oct 2021 08:18:44 +0000 (UTC) X-FDA: 78723372168.39.2DE360C Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf21.hostedemail.com (Postfix) with ESMTP id 5DDBAD0369C4 for ; Fri, 22 Oct 2021 08:18:41 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 5BE1D1FD58; Fri, 22 Oct 2021 08:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634890722; 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=udzLvenaNJ3s/w3myOyFSHoI8PZDzLqGtGnzU72grpQ=; b=tZfVS+GsxB4ztBI/PkTVtzq3zqzVa5Ey0BVI3ujAZ+X0/kU0WMm2JFoQ/dI1UFErKreYzj WLhUzybUFXpwzm8xQ1URT+ic7zij5GZvX9+r0TkHTyRNRBc3/vjyF5pfQEJrTUNxJpiAKB SmEwUou+18lgMrN++sJUBE+oi8MDJVg= 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 2A969A3B84; Fri, 22 Oct 2021 08:18:42 +0000 (UTC) Date: Fri, 22 Oct 2021 10:18:41 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163485654850.17149.3604437537345538737@noble.neil.brown.name> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 5DDBAD0369C4 X-Stat-Signature: w459739msirt7bhpnwa7is6hstbmrrj4 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=tZfVS+Gs; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1634890721-930968 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 Fri 22-10-21 09:49:08, Neil Brown wrote: [...] > However now that I've thought about some more, I'd much prefer we > introduce something like > memalloc_retry_wait(); > > and use that everywhere that a memory allocation is retried. > I'm not convinced that we need to wait at all - at least, not when > __GFP_DIRECT_RECLAIM is used, as in that case alloc_page will either > - succeed > - make some progress a reclaiming or > - sleep There are two that we have to do explicitly vmap_pages_range one is due to implicit GFP_KERNEL allocations for page tables. Those would likely be a good fit for something you suggest above. Then we have __get_vm_area_node retry loop which can be either due to vmalloc space reservation failure or an implicit GFP_KERNEL allocation by kasan. The first one is not really related to the memory availability so it doesn't sound like a good fit. -- Michal Hocko SUSE Labs