Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp333939ybt; Mon, 6 Jul 2020 10:23:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmXFLcAg+DlaC0ABRbuIFTvFTxoZCH3ZZApxfuOgomWxyPq4QiNww0DktVZb3nrdDF5y/m X-Received: by 2002:a05:6402:1d14:: with SMTP id dg20mr20374170edb.23.1594056220425; Mon, 06 Jul 2020 10:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594056220; cv=none; d=google.com; s=arc-20160816; b=nCtXSuaQVIi0W6xp5VopcgNAAjKCcqjI3VwSgnWjnyTwGqU9RcZ1AwBlynxaBci/8U nfrKo97q6HIGbMy//U7jjBm+fDAcWaUvpTgY/IAQQrWbbeBp6BxxvDNGpW6ZLr8OWKEw qEkTAkd3E6OwLY7dK/dUUhFhg3B9Qmn7aHntZKb8b0ioskq4ubwDek361jLXp7ADT4O1 CjFaJgSx/l/oSKjSwtEq0RPj0LmEajjpESiOL4pGY9fvQfVqhtscSeOmHBqUA6cCPlyK Qg5u61vR9nWnEOT4V0/jiAkGbFP5ym8CbYonBakGtoWg0cdVIdZSllcVYQkn5cFTH75i zzjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Dllpe5O4jzCPoK5E+anC2oS6Av7Muju9Jgzfx5I8hXs=; b=Hfe5C8lLuQ6oWvjiuXhGYCyBVCC8wToZOQgggXWMFUwLlFLtOpo2+/unM4NzeNhdoV eEL63SQOSHGGksQKpvFMT6cgzwRo3/ErPFuH2eJU8NGzCeT/QaNColMZNE4FfbvaXo5x bbmM2zkgPqcRcBWpZoOKOy6YjvwtwdYIuYj050LNsh02eJcV9WNa0/HzoxWoyn0fEcb5 VhYx/2LkITJAug9Cw+rR/FzsXxX7zCq7YNIxG2q4/pYhkLPYEug0Nr5FFEDdd68L8hih U93aO0UACxg9ctsTcn+owzVnEn3UEqImNSvE9nzsXkSqStkmtjoUcR23gZxOzaywfveO c5NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xRqXMhbT; 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 w6si13417389edx.62.2020.07.06.10.23.17; Mon, 06 Jul 2020 10:23:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=xRqXMhbT; 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 S1729680AbgGFRVK (ORCPT + 99 others); Mon, 6 Jul 2020 13:21:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:55528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbgGFRVK (ORCPT ); Mon, 6 Jul 2020 13:21:10 -0400 Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 072AA206CD; Mon, 6 Jul 2020 17:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594056069; bh=vyyX1LP4325hfnYgliYCjSjLjNxzM/CYe+v7FBLTqDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xRqXMhbT75r4F5kcZi3w64ouCeYXiKdgLM/wgZLdvIJCQORfZvxYaWRUGv5OSEDjg 7kkrDm+MZiW45gJhMuxLUEamiH/z3BMpoAYoEdPLZrnkj28wASdtZcdxobSGLvGxU8 basl4KvFCVZSptOkID0ZmBIj3iQJSPYik0iVjgcg= From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alan Cox , Andrew Morton , Andy Lutomirski , Christopher Lameter , Dave Hansen , Idan Yaniv , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Peter Zijlstra , "Reshetova, Elena" , Thomas Gleixner , Tycho Andersen , linux-api@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport Subject: [RFC PATCH v2 2/5] mmap: make mlock_future_check() global Date: Mon, 6 Jul 2020 20:20:48 +0300 Message-Id: <20200706172051.19465-3-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706172051.19465-1-rppt@kernel.org> References: <20200706172051.19465-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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 --- 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 9886db20d94f..af0a92f8f6bc 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -349,6 +349,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 59a4682ebf3f..4dd40a4fedfb 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1310,9 +1310,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.26.2