From patchwork Mon Oct 25 15:02:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 12582065 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 A229EC433F5 for ; Mon, 25 Oct 2021 15:03:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 293BC60F0F for ; Mon, 25 Oct 2021 15:03:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 293BC60F0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 67681940008; Mon, 25 Oct 2021 11:03:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 62570940007; Mon, 25 Oct 2021 11:03:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5147B940008; Mon, 25 Oct 2021 11:03:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) by kanga.kvack.org (Postfix) with ESMTP id 41D74940007 for ; Mon, 25 Oct 2021 11:03:37 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D5B6B180357EA for ; Mon, 25 Oct 2021 15:03:36 +0000 (UTC) X-FDA: 78735278832.39.9EB1482 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by imf11.hostedemail.com (Postfix) with ESMTP id 5EEBFF0000B9 for ; Mon, 25 Oct 2021 15:03:36 +0000 (UTC) Received: by mail-ed1-f52.google.com with SMTP id z20so627977edc.13 for ; Mon, 25 Oct 2021 08:03:36 -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=1Nyn6pHF6WFrGnwPiamzO3XhnQYlE9zJJoQ3+36HnQU=; b=aj9ueGmONzBSXwd2R5ePJO6XERy/7wIlGHk/MDq0PJKT2/Z147q2+niY8YH8Q2rQri 5PD3/mr8i2yULuuh30kVcMSV04VutWqodLdvYg687vRwAm//iJx4tHoyM1FdUr01XRQv Z55mdoRczt1lBC/0fJrocIUHYcGhFjhGHDtEoPP6RUeYPZLiGnt123TPHQGxYzFBS/TC BFXo2JzKh00ZvgRUwlyrWCNoYYL1PUdjeTiSensDYdCUk3uNEv7zMQRRprPOzn9tn4iE N06IcGuQ0qzZg6NGmGJwRVfmICDtbR3THknu85enRx/nxlkXxA0e6VBg7MJvuIrHad/s LSYg== X-Gm-Message-State: AOAM531WGDGZH5tASu2U5HtojWeYxBx5HVQOsfcfFFaZL+c+TAyJW/Cp zEqn1QM5AYTxZj5gzQMlAb1Ymdxw/P8= X-Google-Smtp-Source: ABdhPJxI4FD3ukf0VFAW0c5yyigvsk8/K8td5hXew4yerhP9Ku9zWHE1t3ZhRDT1nwO0o435re+ehg== X-Received: by 2002:aa7:dbc1:: with SMTP id v1mr2472050edt.49.1635174162116; Mon, 25 Oct 2021 08:02:42 -0700 (PDT) Received: from localhost.localdomain (ip-85-160-34-175.eurotel.cz. [85.160.34.175]) by smtp.gmail.com with ESMTPSA id u23sm9098221edr.97.2021.10.25.08.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 08:02:41 -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 3/4] mm/vmalloc: be more explicit about supported gfp flags. Date: Mon, 25 Oct 2021 17:02:22 +0200 Message-Id: <20211025150223.13621-4-mhocko@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211025150223.13621-1-mhocko@kernel.org> References: <20211025150223.13621-1-mhocko@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 5EEBFF0000B9 X-Stat-Signature: ixdncbqfiqpgophoh8qtrkxyz1fe4hht Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf11.hostedemail.com: domain of mstsxfx@gmail.com designates 209.85.208.52 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com X-HE-Tag: 1635174216-343742 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: 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 602649919a9d..2199d821c981 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2980,8 +2980,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 */