Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp479996pxb; Mon, 25 Oct 2021 12:03:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd8YySPHh0RoqjepQjZWitCDL6H622sdz3xX6YiS1rOomK46VKzAhI9HXCfMRCtt9671PW X-Received: by 2002:a05:6a00:b83:b0:47b:fbb3:9265 with SMTP id g3-20020a056a000b8300b0047bfbb39265mr5624150pfj.79.1635188610763; Mon, 25 Oct 2021 12:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635188610; cv=none; d=google.com; s=arc-20160816; b=B7t26vxsCd2aG+mTuDKKn+7agL63ZRNeEaRwDfQJqhi3CJaRYVUroDcm50mI1b0Ug3 FEI8J9a2Zti2uF7yn3/W9mMSRp6jOXhtZBOTpxqwNbatsnTHoMQQf+UpuxU5zKqspt0L TnLmyvLdWtPLuT/oVvmWLpgsCyFyehCDCPvlTlqbEFsjJ0wwmM9AZJ3Lt51AnADwLd5W qqjj5aqI+9QQ0aeyDpogSG1YhfQq/sccIoCcwxH0vJ0ghIy4m1t/c49BQfrFXhMa6Pzw JP+VBSr1pCKNgAw6uyf8cWQhPg5lOJ2dLai7CGGrmZxbInmp763PpfzLom0bFd4piTDK /JEA== 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=1Nyn6pHF6WFrGnwPiamzO3XhnQYlE9zJJoQ3+36HnQU=; b=mT9Tez5f/oVlNq31XlVW/nj18ABf2C/fevvg9rjFrhUs6ScBFWuJqvcUxaE0V730TQ JNESWRUi95IUjczB+hvg/aCvgfmC7LZZkyV+I6kPEtNoTNfuPTSPCiMOZmeDw7k6RBDT BREp8CeHjtc4plMc0O+EpCnesvHBBAsOOsMHGYfCihO3j5isRDC2jwIDaHY8Ao4kwA7Y 7DIQjVpXQHxbxoMhbc1m8Y9wnqGh2lB4OalusgJuThnNn8TrpRkw49/zMCPCEBdjKfoz yd2zMayC4ZBOzugBEiBdO3AFyMYSSjUUJkjXLGxeOdbwoZbe755xcNIFqBfRZK+o1l/j hbYg== 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 y184si3777854pgd.514.2021.10.25.12.03.05; Mon, 25 Oct 2021 12:03:30 -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 S233823AbhJYPGZ (ORCPT + 99 others); Mon, 25 Oct 2021 11:06:25 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:41930 "EHLO mail-ed1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233805AbhJYPGV (ORCPT ); Mon, 25 Oct 2021 11:06:21 -0400 Received: by mail-ed1-f48.google.com with SMTP id l13so616967edi.8; Mon, 25 Oct 2021 08:03:58 -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=VLtU1Q2oa2yfkz/EiocMzSMJ21Fdpj0urDpjzZXuwe0Kd7i2lDq2rv+kKo+FDKMcF/ BXBg75RYinmRwK1AA3K3L0WTmRCc17w/uLGW5BHUsZynmUlcjJZI6LbRKkGQQ2LDPXh7 H9VBEMT1GNkoL6BaMnWMMMwO1lc3aiAagO1jDWVi2SZ7Nu1hGnNeftQn9OjHjCX11OxB ck/rm6B1tra1JDvkpeuHy22V7GQ1RlIj7wfG71lOx2EPtGHm9MhdRVLr1qYx+Ouej4w+ f2v0K4ZzeXQ3d+Jlj2hjC7MgNEUeY9TzmCaMh8xHf5BvU1E4T949N8JT9VUNTWwfcyxZ K8zQ== X-Gm-Message-State: AOAM532tzIV6WQ5swOtR/rpOkRrFChGF5lT/xSoOwAOxk1PeSzobDVwg wvd942KBYEgjqAGsw4BycVU= 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 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 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 */ -- 2.30.2