Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4185410pxb; Mon, 8 Feb 2021 09:54:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQJnBBDxuGFRPtZRfG9nG+WHbFM+8sqsayHZBxHGSS1h08gMEMkmYfqUMsqEysNipD0hXM X-Received: by 2002:a17:907:2805:: with SMTP id eb5mr18032355ejc.277.1612806841744; Mon, 08 Feb 2021 09:54:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612806841; cv=none; d=google.com; s=arc-20160816; b=FvVCT7QVq28/RNzgz7mgyj1RfB+pb+cDnS48+6og6EuYrFfoP0To5nbmJ9Kier0u7k Z1AvfOZtweCoP0k1/dqzsppg4U7z4+3HXbJzgVF2BfBlgL8lm4n6BSGJBepaSN8nBMo1 y9Lcxd2FGuqmrO8AvrbgSXywv5nQpgkigjBU2qESmYgZ5q2BjgyWz6O9/lXs/sAPpI8x JNlfdcThQzVVZ/Hdcu1FlRxigCPUL5+W+qM00NJuyZC6yJ0bFTaRv8tcTOSpaKKCrc5A dbtppVv/M98BcR6uBlG7SWmHspruTFtRSCuKZ1CeyjyBsiEVPsKioPrfmCEjG6z7dZRY fp7A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DN4ZES+bKtLUzCaI1CkNVTXQy9mxtFkWE2F3TtOIeN8=; b=Cr6ifAlzg/scVYZT4VZ1QATQJvciElVCNt8mrFyBMUjcI2xQiy0eqn9OnwoAzEULcb dCdmdixOOOmv9tEagGFPthGwIMEL/k6+NF/BJA7tVN5FkbXj6aUai1bcjOmmM8PJ6IJ/ rGskDkJgkmMSBergF2pF61XBhwns1lmVSKHYP0+wCM9184bnl0qTrjTStyxaOM/Jk7TX 2r6OBtFgpW5gU1+bd/NHDfYsPDeUXuybxroyuacJmgfqFsgrOLnwMoPyWJJGcUEb/G9R D7YbdcWnv9u/kLJ7PmTWHV7AsFaTGIm2utI8+p4W7siCQK1wDynF+uRiResbYWkXzJLm e5Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rgsZ1BOq; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si11626106eja.539.2021.02.08.09.53.32; Mon, 08 Feb 2021 09:54:01 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=rgsZ1BOq; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235092AbhBHRw5 (ORCPT + 99 others); Mon, 8 Feb 2021 12:52:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:38018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbhBHPct (ORCPT ); Mon, 8 Feb 2021 10:32:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C98364F46; Mon, 8 Feb 2021 15:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797486; bh=iDI0YLuR5E4aCwbcunmmVQtRUV+qgMzfWK7MPyhvdZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rgsZ1BOqj4cBatolaKWPn3EYQykYZLQQaVuBm6QkNDd+zGU35xEmIomNb/NsmzHOS iPBRNw7PKDOPBBL0ZH1s++Yf6ZgiYdQ/e5wgM+WGjn4Y8xv3mZoxnGPNvVWjnVR8NU JfLUZ5+Sa7Dv3q8zv0L71rJaJ6GwyyMSRfBaBopo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rick Edgecombe , Matthew Wilcox , Miaohe Lin , Christoph Hellwig , Daniel Axtens , Andrew Morton , Linus Torvalds Subject: [PATCH 5.10 103/120] mm/vmalloc: separate put pages and flush VM flags Date: Mon, 8 Feb 2021 16:01:30 +0100 Message-Id: <20210208145822.482826186@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145818.395353822@linuxfoundation.org> References: <20210208145818.395353822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rick Edgecombe commit 4f6ec8602341e97b364e4e0d41a1ed08148f5e98 upstream. When VM_MAP_PUT_PAGES was added, it was defined with the same value as VM_FLUSH_RESET_PERMS. This doesn't seem like it will cause any big functional problems other than some excess flushing for VM_MAP_PUT_PAGES allocations. Redefine VM_MAP_PUT_PAGES to have its own value. Also, rearrange things so flags are less likely to be missed in the future. Link: https://lkml.kernel.org/r/20210122233706.9304-1-rick.p.edgecombe@intel.com Fixes: b944afc9d64d ("mm: add a VM_MAP_PUT_PAGES flag for vmap") Signed-off-by: Rick Edgecombe Suggested-by: Matthew Wilcox Cc: Miaohe Lin Cc: Christoph Hellwig Cc: Daniel Axtens Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- include/linux/vmalloc.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -24,7 +24,8 @@ struct notifier_block; /* in notifier.h #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ #define VM_NO_GUARD 0x00000040 /* don't add guard page */ #define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */ -#define VM_MAP_PUT_PAGES 0x00000100 /* put pages and free array in vfree */ +#define VM_FLUSH_RESET_PERMS 0x00000100 /* reset direct map and flush TLB on unmap, can't be freed in atomic context */ +#define VM_MAP_PUT_PAGES 0x00000200 /* put pages and free array in vfree */ /* * VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC. @@ -37,12 +38,6 @@ struct notifier_block; /* in notifier.h * determine which allocations need the module shadow freed. */ -/* - * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with - * vfree_atomic(). - */ -#define VM_FLUSH_RESET_PERMS 0x00000100 /* Reset direct map and flush TLB on unmap */ - /* bits [20..32] reserved for arch specific ioremap internals */ /*