Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1267722pxb; Wed, 20 Oct 2021 01:27:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/Q5Aqk93khll7kRkemk/BMa1nUdNtPI9rxL+QD29i8xMJHdLIkssHTMaQymSN4eDRpSVC X-Received: by 2002:a17:902:d114:b0:13f:5164:2e1c with SMTP id w20-20020a170902d11400b0013f51642e1cmr38014922plw.75.1634718440536; Wed, 20 Oct 2021 01:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634718440; cv=none; d=google.com; s=arc-20160816; b=mfn+0rKvwwo90qUwljP4f38Uc06ueZ5lGEnU1jpL8HNWn7o75NQWL5rZbcUV8+4nEB BW0TIP17+42J8EoTsy3IDr7ETU/soVlwsn45jJ1DARjSqxUFKbUDDbfTI0zuwVdaoJsA YpZwQ9bYft9+1KGrvAi9AEpkICj5+10Z9pf8tpQkyNXfTTC74I9ub7JlvXk/f1K2oCIR ZPztvmRyQV9loixqQQBTyGj7mjjsR6Tnfr2nlWRMM2eiOGblzWxL/0klNvbhUP5mn8Wx 7k+eCO16BcYNT2DgSjxwNcAifjkw6vzkzK7VJIUlB+G3riN3ugL1UgRpxAjjAqwn8yZk chyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pgSRS53yor4/W1ex9Z2HbXrLEzhX0+rUSDcCEksYWe4=; b=OYVqIHNpW2WmnVFL3DOXzOu6BkQ1M1tQSS2k8/BIzWdXThTG+o3chKqMS/sIaPPAzG n8n4xEyQTeMKyZ3AvtJJSMXsEVMA4yMIK77cUy25OCt9NASESAKKBnnRnCuYgJI34RjH w9enPmCHzBvR21g+RLzilsCGTa8epzSfyX4cZeLoy3sexddMFEwG3nSgVUDeVujEEEIY YUb09KdClUf28xJP3jBDPr4JPze3qEeBdDtF8oP2SqZWaaA2OHoqQP35QdwLE13Q8DZr 0QPvxcLcFjC7421ujMlSHAlebEhXHMIN44pDyWMMbq5DVRE+MN0GRzcKvYVL7QZIgf+M 5j3g== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si2097750pgv.331.2021.10.20.01.27.07; Wed, 20 Oct 2021 01:27:20 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbhJTI2M (ORCPT + 99 others); Wed, 20 Oct 2021 04:28:12 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:53229 "EHLO mail-wm1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhJTI2J (ORCPT ); Wed, 20 Oct 2021 04:28:09 -0400 Received: by mail-wm1-f47.google.com with SMTP id m42so17060694wms.2; Wed, 20 Oct 2021 01:25:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pgSRS53yor4/W1ex9Z2HbXrLEzhX0+rUSDcCEksYWe4=; b=ab0piIwAYH3jFHS9Pz+jFFY/gLaaGlcODscVoFh3F5cg1S1O/qYm4WZ+paWorhgzFA zHgiCXqV0ui89twdVA2oabevd9eLMzg3KnOk0ut5MPRj50PPac4SUkK0bVAXD7Rja94t gpBpJmWYwZLFruwN05CxE3EnzxihPWaTPCPU2x9BtCM8jQ4HWTlg+nRCucUVy6Wuc6NH x0BjGSih+gWsZZWyvBpbdj6HgR4Aac4w8LZToIsKWbzGhxuhPpmNFgS3H+9djUtqdfjM /qm7BVCKPAcT9JMrfdoDTsOHpAxVF1BeU6/cor7TICj5/R2rh2W1teBS9+3zD6wvLBv2 Kpxw== X-Gm-Message-State: AOAM533hInBkcR9eS+wYSrS/wjMypz3+w7PtYTZSloTIy5PIqWnDfvIs 4WJ+PUjjiUl4nTmjGa5r1Ts= X-Received: by 2002:a7b:c14b:: with SMTP id z11mr11968924wmi.67.1634718354848; Wed, 20 Oct 2021 01:25:54 -0700 (PDT) Received: from localhost.localdomain (ip-85-160-35-99.eurotel.cz. [85.160.35.99]) by smtp.gmail.com with ESMTPSA id c3sm1317047wrw.66.2021.10.20.01.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 01:25:54 -0700 (PDT) From: Michal Hocko To: Cc: Dave Chinner , Neil Brown , Andrew Morton , Christoph Hellwig , Uladzislau Rezki , , LKML , Ilya Dryomov , Jeff Layton , Michal Hocko Subject: [PATCH] mm/vmalloc: be more explicit about supported gfp flags. Date: Wed, 20 Oct 2021 10:25:45 +0200 Message-Id: <20211020082545.4830-1-mhocko@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211018114712.9802-3-mhocko@kernel.org> References: <20211018114712.9802-3-mhocko@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Hocko 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. Signed-off-by: Michal Hocko --- mm/vmalloc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index f7098e616883..f57c09e98977 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2979,8 +2979,16 @@ static void *__vmalloc_area_node(struct vm_struct *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 + * supported. From the reclaim modifiers__GFP_DIRECT_RECLAIM is required (aka + * GFP_NOWAIT is not supported) and only __GFP_NOFAIL is supported (aka + * __GFP_NORETRY and __GFP_RETRY_MAYFAIL are not supported). + * __GFP_NOWARN can be used to suppress error messages about failures. + * + * Map them into contiguous kernel virtual space, using a pagetable + * protection of @prot. * * Return: the address of the area or %NULL on failure */ -- 2.30.2