Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1426824pxb; Tue, 26 Oct 2021 08:49:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8jEANnJO7gL4S8z4e2w5E9C2go/j07qtqxc58ES6kozKfAO3LnSTlGjdN1fz+4CzpOYgz X-Received: by 2002:a62:445:0:b0:44c:3b5b:f680 with SMTP id 66-20020a620445000000b0044c3b5bf680mr27210571pfe.30.1635263371174; Tue, 26 Oct 2021 08:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635263371; cv=none; d=google.com; s=arc-20160816; b=rHP5vYK6BbtZsllfQctcwgOcJeXw4ioqes1qibA8XTT/EzeKiU/09p1yHc8ASBe3aB T34u2A83jWc1As9qHnuTeB+pbtrBvXwHKUjjZHKPARhmM1w4iosggb75xSs+xXjNYbcJ VJhyEVjrdY6X9y2MX8mu/p6GcrQu4cMBDj7ABJ7B6egkacsGMB571w+ya5E+1yNcfJru eqmJ8na5pxb7SpcJ7o3mo7UBGcUl9aOXw2HwlAV4XFBZf1EUPHo/EIFmz6FIcr8NAa1m YHnXEYK1yw4dUq64h4YRFT8DLWhdSXFxxUVd74PHiWUjYHYmF5bBeSTcXipT5tNhK849 076g== 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=1jmbsMYMBnwRLDZZZODInYHlDPDdcNd8+Y3UhCIDNAY=; b=e7DHfSFFOV/liof87eN+lE6d6hTc3vPAWf3d2SaVrMAtOEooOPE2UppEbRoj+2MRnl pSbZdhiqdAK7OG4xM+aa8X01YQSWUMidhS9+RBkj/1bjkS5Hy0hEPsJXKbPOdw150v8J NulLfDvoCUiROPfb8kuHe/0Ir6ObQkB2wf9RVW+idfEfrnUIprjR35ZsAwwqD9hdW7kJ zF2Av/O2QLS3oE++FT4OjEdyzkLwcfmtXzOfnCWTZCYF+NNko5JOj/utfJeDWbGR2POs JA3cZ+QB0vttP8fGsIBU9LM/m7BQEI7OhQumzYFaQh6RbbNL45HEhMrjKG2kf8ucsmVR RHhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=l04Ah1in; 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 t25si20390929pga.393.2021.10.26.08.49.04; Tue, 26 Oct 2021 08:49:31 -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=l04Ah1in; 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 S234933AbhJZLb0 (ORCPT + 99 others); Tue, 26 Oct 2021 07:31:26 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:58976 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbhJZLbZ (ORCPT ); Tue, 26 Oct 2021 07:31:25 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id E8AC0218A8; Tue, 26 Oct 2021 11:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1635247740; 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=1jmbsMYMBnwRLDZZZODInYHlDPDdcNd8+Y3UhCIDNAY=; b=l04Ah1inYgpyluUguCEBsLjXBsuLa8C/kDjPsksFKBY/8/Ii5ws62SBB1cGtlGi+S2a/nz YhcryyBI1BjKnXDEzAdwpmrLLK3N5/MTcGnCBz+fQLUmZzhBxv0WZiCCxqJXMfaXJJda+4 Uj+ZSSlzAq1kOhCnw+hzw0rmhqSp80c= 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 9F783A3B81; Tue, 26 Oct 2021 11:29:00 +0000 (UTC) Date: Tue, 26 Oct 2021 13:29:00 +0200 From: Michal Hocko To: NeilBrown Cc: linux-mm@kvack.org, Dave Chinner , Andrew Morton , Christoph Hellwig , Uladzislau Rezki , linux-fsdevel@vger.kernel.org, LKML , Ilya Dryomov , Jeff Layton Subject: Re: [PATCH 2/4] mm/vmalloc: add support for __GFP_NOFAIL Message-ID: References: <20211025150223.13621-1-mhocko@kernel.org> <20211025150223.13621-3-mhocko@kernel.org> <163520277623.16092.15759069160856953654@noble.neil.brown.name> <163524425265.8576.7853645770508739439@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163524425265.8576.7853645770508739439@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 26-10-21 21:30:52, Neil Brown wrote: > On Tue, 26 Oct 2021, Michal Hocko wrote: > > On Tue 26-10-21 09:59:36, Neil Brown wrote: > > > On Tue, 26 Oct 2021, Michal Hocko wrote: > > [...] > > > > @@ -3032,6 +3036,10 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, > > > > warn_alloc(gfp_mask, NULL, > > > > "vmalloc error: size %lu, vm_struct allocation failed", > > > > real_size); > > > > + if (gfp_mask & __GFP_NOFAIL) { > > > > + schedule_timeout_uninterruptible(1); > > > > + goto again; > > > > + } > > > > > > Shouldn't the retry happen *before* the warning? > > > > I've done it after to catch the "depleted or fragmented" vmalloc space. > > This is not related to the memory available and therefore it won't be > > handled by the oom killer. The error message shouldn't imply the vmalloc > > allocation failure IMHO but I am open to suggestions. > > The word "failed" does seem to imply what you don't want it to imply... > > I guess it is reasonable to have this warning, but maybe add " -- retrying" > if __GFP_NOFAIL. I do not have a strong opinion on that. I can surely do diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 602649919a9d..3489928fafa2 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3033,10 +3033,11 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, VM_UNINITIALIZED | vm_flags, start, end, node, gfp_mask, caller); if (!area) { + bool nofail = gfp_mask & __GFP_NOFAIL; warn_alloc(gfp_mask, NULL, - "vmalloc error: size %lu, vm_struct allocation failed", - real_size); - if (gfp_mask & __GFP_NOFAIL) { + "vmalloc error: size %lu, vm_struct allocation failed%s", + real_size, (nofail) ? ". Retrying." : ""); + if (nofail) { schedule_timeout_uninterruptible(1); goto again; } -- Michal Hocko SUSE Labs