Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3833110pxb; Mon, 8 Feb 2021 00:59:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcVGOhJ+SK0h3vfU9Cr+OhIDTjobwvW87tXIUBi5vw840Qn4z6mgUI8uhC57672in281z5 X-Received: by 2002:a17:906:af41:: with SMTP id ly1mr15471417ejb.525.1612774762922; Mon, 08 Feb 2021 00:59:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612774762; cv=none; d=google.com; s=arc-20160816; b=05V/a4/WqKvvvhUDX3u1il3rbkzr0pmnNDMGFbGEcIxZ/Hp3gRXpj8DRghP0gJxlja 8t5Is25vjpK8snhBc5QxvYYmj4KpJ2NCPFWTbLT4+QbTQUvPFwQ2+33yqOKiSXR8meXE cma42TJdZeLPbiCAyNtYyZW9VSL6b9lUvqd0PpNa0pDaQf0O5TTN3gV7IR2bcbIgX6Ve 65/kF76a1LpgThaxl0pBvowbcxge/YqOjZAzgn+5SyqUITZmexrUhHVyNH7scJlbZgT6 JwP6/xOyDVS5pJaI1IljdtkSmLFxw6Y34n7YxdnpA4l6faL3oQVU5/7l9wykEhk0hHCF gCMA== 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 :dkim-signature; bh=VuqhfZzckE62qXTkL0AZ+E7UOP39M2/KJHeQ1FyI7Bo=; b=Ewn37wbzSqAsOqrHE9Inv8cUoKi4yn/HKF9cTp3OVXIOumqoT4fQDjlnomUTSjPsDV k1Y7qq3YH+miA/6lPq1LUHjI5YIU+4X+vY5u7Lm+GfLBKk3R9VdJnYAQLQEiWjmU7qge MG2UAXNmzW73CfNN+YAtQvhSr3rWQ7nk38fOszCYEmKIFj7mN1hTn6vokgzd4dD39Afu aiVa9Ft2sQ9DHh1/QVC+H5VFWm/NXm07FgVpbvaqPsZ5cChdUexWmVxfDFQYDa5mRJk8 nhDdJuYH1TkzIfFkac6ODUFADGXGVDCTUMgn8UNsuYl2/AnJp58/t4VAAYw4PCCMIVXA c04A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DNV/Rxwt"; 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 l18si10457777eje.178.2021.02.08.00.58.59; Mon, 08 Feb 2021 00:59:22 -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=@kernel.org header.s=k20201202 header.b="DNV/Rxwt"; 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 S231243AbhBHI5w (ORCPT + 99 others); Mon, 8 Feb 2021 03:57:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:42178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbhBHIuz (ORCPT ); Mon, 8 Feb 2021 03:50:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2AF2264E8B; Mon, 8 Feb 2021 08:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612774200; bh=iee2dGZmaG4EKHM9QU8vrsOr5P0gX21AcMxI1zm4D/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DNV/RxwtFv72Qaelz4AAKxK8z+dz0PjIGsnq95n5dd3yha7W96yd8XZSlnRhClIJH sp7nS+U5FWmhehwN/5+Kl3QbGG1ukCDkg3DTf+UyT4V/0y+Q7kp8wem1KxwBFtoNNW 14M7nrT/60RyVmmGSGI/K3GYlwpsRZ0Z+Wr62RPqAHHj3zlLWmOKXtCYmySc830/Rl RzX0BlyQUfYwtSh1O5aFd63QOKMOUEDkLqh5OOtf+Ya7mBeepdILrQ1rvLAEukAAfK VtEmmO0KWoVPYv2gr9t020bQoCOl63Qp4hle5kRqT9LFrmW1FKGoTlEFYCJ0UbwiaP pMDJxs7sDeGUQ== From: Mike Rapoport To: Andrew Morton Cc: Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , David Hildenbrand , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Michal Hocko , Mike Rapoport , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org, Hagen Paul Pfeifer , Palmer Dabbelt Subject: [PATCH v17 02/10] mmap: make mlock_future_check() global Date: Mon, 8 Feb 2021 10:49:12 +0200 Message-Id: <20210208084920.2884-3-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210208084920.2884-1-rppt@kernel.org> References: <20210208084920.2884-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Rapoport It will be used by the upcoming secret memory implementation. Signed-off-by: Mike Rapoport Cc: Alexander Viro Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christopher Lameter Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Elena Reshetova Cc: Hagen Paul Pfeifer Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: James Bottomley Cc: "Kirill A. Shutemov" Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael Kerrisk Cc: Palmer Dabbelt Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Rick Edgecombe Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Cc: Thomas Gleixner Cc: Tycho Andersen Cc: Will Deacon --- mm/internal.h | 3 +++ mm/mmap.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 9902648f2206..8e9c660f33ca 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -353,6 +353,9 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma) extern void mlock_vma_page(struct page *page); extern unsigned int munlock_vma_page(struct page *page); +extern int mlock_future_check(struct mm_struct *mm, unsigned long flags, + unsigned long len); + /* * Clear the page's PageMlocked(). This can be useful in a situation where * we want to unconditionally remove a page from the pagecache -- e.g., diff --git a/mm/mmap.c b/mm/mmap.c index 28ef5e29152a..10b9b8b88913 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1346,9 +1346,8 @@ static inline unsigned long round_hint_to_min(unsigned long hint) return hint; } -static inline int mlock_future_check(struct mm_struct *mm, - unsigned long flags, - unsigned long len) +int mlock_future_check(struct mm_struct *mm, unsigned long flags, + unsigned long len) { unsigned long locked, lock_limit; -- 2.28.0