From patchwork Thu May 13 18:47:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 12256231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4DB6C433B4 for ; Thu, 13 May 2021 18:50:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BAC261206 for ; Thu, 13 May 2021 18:50:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BAC261206 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fwIwSXAHF9tPQK11/IF6MkjJB9C1sSo3Nxl0itJVJuY=; b=g92jmL3RnG3btVDa2dGkWXvuW Tf4II6L5VrJuG8xQhnXY3rlAiEJJ0dWM1ess5dZaYUHST4xTqOsjyb8qqxEm//bPnXZLc2UflN9J1 1Sp3KftQ+4cb8BkxYs67JcsX8CoarJLVO0PdFM352tPN0i4qpRPuWwgVpYF7iXzOMbicqZ//BsMcl LHbD8NZ4JApq6aD+b8r2wE5TlC4mS4ggQmz4EyVFcgeD/5PU/nUpJ93T2oA1OGd5df89BijvgBDx4 11Cap910yrhSw5zZqTjSslaLfSWtKlnWJyORAqPBzN6/qe+/qPqwsRMv+Uh7U6M8yticiUfJK9u+U P0IIi6gEA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhGNl-006AuY-6j; Thu, 13 May 2021 18:48:25 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhGNR-006Arl-H7; Thu, 13 May 2021 18:48:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=4IiXZBAZ99nqMrohxPiVvS0VuwnY4FTB8YfNNRgC+HU=; b=f+SzNPCQomumb7ZdUqs5J6vsG4 EfEnfLtyLA2QmTwsDAfxf/FU32l3uJXZYTmI8wGwo1f0wnB7o2UKqPUayYD4K4kFJw+4oYcLY7NRd gz/lbRfXB4c6kKj5bbZyMjR/+sxPegJvD3nWRynFkHeWD6QrJM7wTpe+N4yCoyk9BeWo2EX5J79p5 8AVAqpE/Uf7C4GJ0KCNoqDphmFP1VSC2cKb5Y2SE6gfj4PZsZBjqMbmDBmLiWH3qoO4fIuW7iB9bm XXxn4L8G7CxmRgNJhjLqzupkFNH95dNafW7mzEgQ/6RnRJlachnIEsjrRFYtgMuglgo9YTm5PGXzl 7Y23ck2g==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhGNN-00BRsY-QT; Thu, 13 May 2021 18:48:04 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6ECD5613F7; Thu, 13 May 2021 18:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620931681; bh=Xjs/+IJYgGP9JO5LFAahNlRS2obhEsa56sl6FC9Cy6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtFi2YVgXfCQTLRCZzZmp6EpNpPbzcG9X8o558JR7jk8bujJkksI+h6JbOqgsnKkw PM5NEA6ws0tU1bhsd5HXZ39uFhPrdsig3zdZu0+OBb7wHYZYWGEmUzZaG27e1tFF/L 3T2r/R7wkz1dZqA2kzm/eui05Qgoyn1K9+VEDXPYxXpCUEPSWaV8ZzjSQMM1CIvK5y U5mIQ91bSRWYlACU3u4GiC95jeuJrVN8oUbAraAOCsymJ/+RM/rr51s8VvDWZU74Cn DcGSskZDhFFUbUhOvLWLjUQCPnwpBtWfmhHV+AY2R4fmcXkONe7H0m4TpKlHKL94Mw UVlVoVlUQZXyA== 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" , Hagen Paul Pfeifer , Ingo Molnar , James Bottomley , Kees Cook , "Kirill A. Shutemov" , Matthew Wilcox , Matthew Garrett , Mark Rutland , Michal Hocko , Mike Rapoport , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , "Rafael J. Wysocki" , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , Yury Norov , 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 Subject: [PATCH v19 1/8] mmap: make mlock_future_check() global Date: Thu, 13 May 2021 21:47:27 +0300 Message-Id: <20210513184734.29317-2-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210513184734.29317-1-rppt@kernel.org> References: <20210513184734.29317-1-rppt@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_114801_929772_B81D6D80 X-CRM114-Status: GOOD ( 15.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: David Hildenbrand --- 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 54bd0dc2c23c..46eb82eaa195 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -373,6 +373,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 0584e540246e..81f5595a8490 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1352,9 +1352,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;