Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1469685pxb; Fri, 22 Oct 2021 01:20:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDg/m+1ycCOkSnkXlXpBtsNdafpc8bcDwdrC76PRfm+mjA6+VIMOpNJLmpHwvHEhqcNqCq X-Received: by 2002:a17:902:9a04:b0:13a:1ae3:add2 with SMTP id v4-20020a1709029a0400b0013a1ae3add2mr9925262plp.28.1634890827646; Fri, 22 Oct 2021 01:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634890827; cv=none; d=google.com; s=arc-20160816; b=obke6NMx8BDjLTyFGRDdkL3F3wGGBDudc//rpqfAb6mzq2dF2/+uL9cKQGGTtKSRyR 4LRlw9dndjpeGCKHXqRzm5PVvT8hUN/qgPLZeXAjLt0ArUxfawGjsEaJk9OmLzu1b/7t f66zyaIB/n8Aqs44MTcnNvlbTtnKK9W3407LvXLNkDaOQuCCo90CqxQorQvIIC9UFE1r cRdkIbR6duOM/+a7v4yxOA5jt4BUd5Qz/qEl/VSGJXlO8oxQDfgd3oOPTCfbF8us00vg mphhHzZwrJIcXMhCU4XGsY7RQLllHbVIqDAxmzfsBVxmHqzM7If/6PVWd/77qEphvkqq cPKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=udzLvenaNJ3s/w3myOyFSHoI8PZDzLqGtGnzU72grpQ=; b=vZEDtMUmxNTyLdaH6HeAQ4/HhkU8ekdv/D+uzjJBoG3PDB+eZAMsd3dXnZNXY5j0SE qljiDbeuPHL2SeTTxpmZfIpoMiEc8Xo/RUbr8ll5VgX836JabhgprYIxfqOb0G5x7jN2 XlK33+YOWY2DONiuLsV/IyGCSi+jU7V2YKBbhQTwO0vWewBkYK/FKTfnOaLVdmZKSCMe LpATOr0AFSnKH4z0F005iWHAPD83OnfU+RKS38x+lwdveTSEqE7ELc2eXSzSbUksvoRq AeOIkAAjJ2rKsbHzX6IC2sy0mQU8DJjk0Pm0Gtowq3P9rdIXqkmFOsK81lTkqV+l1yeq 97rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tZfVS+Gs; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si2908508plr.37.2021.10.22.01.20.14; Fri, 22 Oct 2021 01:20:27 -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.com header.s=susede1 header.b=tZfVS+Gs; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232213AbhJVIVB (ORCPT + 99 others); Fri, 22 Oct 2021 04:21:01 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:48952 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231846AbhJVIVA (ORCPT ); Fri, 22 Oct 2021 04:21:00 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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