Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1335385pxb; Tue, 26 Oct 2021 07:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycF62Xk+rtcfjyppHd8KZd6lRotpaMQGiKaVLWHFDOXfyaBA2JshgtkMVAxEy/rHOAnvNp X-Received: by 2002:a63:6e8f:: with SMTP id j137mr18873410pgc.381.1635257637218; Tue, 26 Oct 2021 07:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635257637; cv=none; d=google.com; s=arc-20160816; b=Tlwtk1MCp3ihV4YJL5Gqg6J4lajaFmphChuvpNNFBfxnhftFWSXoHx1XHLnTIqQXqE uyEdctLQpNd4JPnlSEUBhcfZElG69DIQwrwmmRaAxhw3ddeD5twXtxXOuqwcdreMqcG0 Nhoe0HXVP4uPg5/Jbtr9SUoHrSXo/llUGPQ1zcHhkxJGE1Dqir/aYtH0Yr/hmIqVOTQr Ho27A/J6N3g/+qCAkZ9wEQKp008j6joXZXkcBqfPYAIbTSLNTDyQ0HTM54GjtvIVcG9i tqeYcjM7Ys7PahWDJyJgkhesH3u4r/boZPfkgJIB0fTAp8EZRBmPYHDpHmLJcnVSzqXx L6Ag== 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=QUWC6kRvFrBZ/khLHEZn47cIYMvYz0u1VgaJCPHSq0I=; b=R9bLl3X5M1UulBWa86S+2yJ56zv26xZhRbOc9IOZdjW4tjf0g4IcxzfYbWgVhcaSYY HERBIeAPAif2u10D4Qce4pD/kaNeAaaNr3C9sX6Lg29LmOs4jIUQX3Jse0gU5vAspBBw gDFDtiIYqu+WAZQ/ezaGIhqCzR3vSD2X00drB5gnBPXj09RhzZ9e6ilcJ5eP1GSiKhv6 UiVKJJNN3ysg5fCwSQcF4axwpz6SDnOtUiEf6Dw939Kfb8r0Mk83n140hHRcvcyO61b9 pl56UymqWJm1a8JS1KXlP+l6zZiAOpQr04yqLruKBwZWkwXMyAqi7Z+W4iMBmyxHT9H/ kaWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=yPn8McOO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=OXoFuXs5; 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 q12si36579259plx.447.2021.10.26.07.13.43; Tue, 26 Oct 2021 07:13:57 -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=yPn8McOO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=OXoFuXs5; 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 S234894AbhJZKpt (ORCPT + 99 others); Tue, 26 Oct 2021 06:45:49 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:48706 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231345AbhJZKpr (ORCPT ); Tue, 26 Oct 2021 06:45:47 -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 840C31F770; Tue, 26 Oct 2021 10:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635245003; 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=QUWC6kRvFrBZ/khLHEZn47cIYMvYz0u1VgaJCPHSq0I=; b=yPn8McOOf5tamAdrJt8EEw9IK32OVCG2aiIjBzxckmGtZlQOtzeJ6UodKvNkrw0pipwxmG Ri1o4X9vbX6pQEtkXdwspJ2NOPM20oMxKbWbILyQqjf3ACqmsId/ihNKn2kCTwRxJrf5Xk xng+L5Bg2xiNkQb+9XyYDGrOqduoCB8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635245003; 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=QUWC6kRvFrBZ/khLHEZn47cIYMvYz0u1VgaJCPHSq0I=; b=OXoFuXs5TNC+z8W0lHHOg9lP5nbHQv6SjAkAPBrdsLVKQQ/ePJHenaqMoAVFUgmkDq6azi K48YgKsSy1OlHqBg== 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 A26E813D43; Tue, 26 Oct 2021 10:43:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Cb4vGMjbd2GBHAAAMHmgww (envelope-from ); Tue, 26 Oct 2021 10:43:20 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Michal Hocko" 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 3/4] mm/vmalloc: be more explicit about supported gfp flags. In-reply-to: References: <20211025150223.13621-1-mhocko@kernel.org>, <20211025150223.13621-4-mhocko@kernel.org>, <163520436674.16092.18372437960890952300@noble.neil.brown.name>, Date: Tue, 26 Oct 2021 21:43:17 +1100 Message-id: <163524499768.8576.4634415079916744478@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Oct 2021, Michal Hocko wrote: > On Tue 26-10-21 10:26:06, Neil Brown wrote: > > On Tue, 26 Oct 2021, Michal Hocko wrote: > > > From: Michal Hocko > > >=20 > > > The core of the vmalloc allocator __vmalloc_area_node doesn't say > > > anything about gfp mask argument. Not all gfp flags are supported > > > though. Be more explicit about constrains. > > >=20 > > > Signed-off-by: Michal Hocko > > > --- > > > mm/vmalloc.c | 12 ++++++++++-- > > > 1 file changed, 10 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > > > index 602649919a9d..2199d821c981 100644 > > > --- a/mm/vmalloc.c > > > +++ b/mm/vmalloc.c > > > @@ -2980,8 +2980,16 @@ static void *__vmalloc_area_node(struct vm_struc= t *area, gfp_t gfp_mask, > > > * @caller: caller's return address > > > * > > > * Allocate enough pages to cover @size from the page level > > > - * allocator with @gfp_mask flags. Map them into contiguous > > > - * kernel virtual space, using a pagetable protection of @prot. > > > + * allocator with @gfp_mask flags. Please note that the full set of gfp > > > + * flags are not supported. GFP_KERNEL would be a preferred allocation= mode > > > + * but GFP_NOFS and GFP_NOIO are supported as well. Zone modifiers are= not > >=20 > > In what sense is GFP_KERNEL "preferred"?? > > The choice of GFP_NOFS, when necessary, isn't based on preference but > > on need. > >=20 > > I understand that you would prefer no one ever used GFP_NOFs ever - just > > use the scope API. I even agree. But this is not the place to make > > that case.=20 >=20 > Any suggestion for a better wording? "GFP_KERNEL, GFP_NOFS, and GFP_NOIO are all supported". >=20 > > > + * supported. From the reclaim modifiers__GFP_DIRECT_RECLAIM is requir= ed (aka > > > + * GFP_NOWAIT is not supported) and only __GFP_NOFAIL is supported (aka > >=20 > > I don't think "aka" is the right thing to use here. It is short for > > "also known as" and there is nothing that is being known as something > > else. > > It would be appropriate to say (i.e. GFP_NOWAIT is not supported). > > "i.e." is short for the Latin "id est" which means "that is" and > > normally introduces an alternate description (whereas aka introduces an > > alternate name). >=20 > OK > =20 > > > + * __GFP_NORETRY and __GFP_RETRY_MAYFAIL are not supported). > >=20 > > Why do you think __GFP_NORETRY and __GFP_RETRY_MAYFAIL are not supported. >=20 > Because they cannot be passed to the page table allocator. In both cases > the allocation would fail when system is short on memory. GFP_KERNEL > used for ptes implicitly doesn't behave that way. Could you please point me to the particular allocation which uses GFP_KERNEL rather than the flags passed to __vmalloc_node()? I cannot find it. >=20 > >=20 > > > + * __GFP_NOWARN can be used to suppress error messages about failures. > >=20 > > Surely "NOWARN" suppresses warning messages, not error messages .... >=20 > I am not sure I follow. NOWARN means "do not warn" independently on the > log level chosen for the message. Is an allocation failure an error > message? Is the "vmalloc error: size %lu, failed to map pages" an error > message? If guess working with a C compiler has trained me to think that "warnings" are different from "errors". >=20 > Anyway I will go with "__GFP_NOWARN can be used to suppress failure message= s" >=20 > Is that better? Yes, that's an excellent solution! Thanks. NeilBrown > --=20 > Michal Hocko > SUSE Labs >=20 >=20