From patchwork Tue Feb 25 10:22:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11403175 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB99014D5 for ; Tue, 25 Feb 2020 10:23:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 88EFD20714 for ; Tue, 25 Feb 2020 10:23:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="CvwBMF9x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88EFD20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8564D6B0005; Tue, 25 Feb 2020 05:23:56 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7DE856B0006; Tue, 25 Feb 2020 05:23:56 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A68E6B0007; Tue, 25 Feb 2020 05:23:56 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 537276B0005 for ; Tue, 25 Feb 2020 05:23:56 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DD7B7824556B for ; Tue, 25 Feb 2020 10:23:55 +0000 (UTC) X-FDA: 76528263630.29.rifle95_224189337c732 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=317a3a273=sjpark@amazon.com,,RULES_HIT:30012:30054:30064,0,RBL:207.171.184.29:@amazon.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:35,LUA_SUMMARY:none X-HE-Tag: rifle95_224189337c732 X-Filterd-Recvd-Size: 4623 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Feb 2020 10:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1582626236; x=1614162236; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=kAdTeVn39NF6MtyWxbSfFrMuEluavNfxQ8uqZzEFpes=; b=CvwBMF9x9ZRNs8j5dpaKJEoOgEFZhZv3nWXc/ZhApUEniaIcEQZJXihu UwUG4pDXRgCN74MsgDgCAyqZHooHNfqXw8tkM+hUTl0bXxz3WP76t0n8k Gsxh8+1UM6EnYk2B1yZq6i9Lfpps+hTmiLl7WN4mQEpsbHX5J7h7fThhz E=; IronPort-SDR: 6wwrgkGYYv8CpR1fY1H7m84KIHG0aC7W/f56Ef/NEvS6zsJ76rwI6GR2ureJsBKf5rUl3zLmHN 0DU74Z+OjKEQ== X-IronPort-AV: E=Sophos;i="5.70,483,1574121600"; d="scan'208";a="27313100" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-97fdccfd.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 25 Feb 2020 10:23:50 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-97fdccfd.us-east-1.amazon.com (Postfix) with ESMTPS id 2B969A2B80; Tue, 25 Feb 2020 10:23:40 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Tue, 25 Feb 2020 10:23:40 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.53) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 25 Feb 2020 10:23:28 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v3 1/7] mm/madvise: Export madvise_common() to mm internal code Date: Tue, 25 Feb 2020 11:22:54 +0100 Message-ID: <20200225102300.23895-2-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200225102300.23895-1-sjpark@amazon.com> References: <20200225102300.23895-1-sjpark@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.43.162.53] X-ClientProxiedBy: EX13D30UWC001.ant.amazon.com (10.43.162.128) To EX13D31EUA001.ant.amazon.com (10.43.165.15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: SeongJae Park This commit exports ``madvise_common()`` to ``mm/`` code for future reuse. Signed-off-by: SeongJae Park --- mm/internal.h | 4 ++++ mm/madvise.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/internal.h b/mm/internal.h index 3cf20ab3ca01..dcdfe00e02ff 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -576,4 +576,8 @@ static inline bool is_migrate_highatomic_page(struct page *page) void setup_zone_pageset(struct zone *zone); extern struct page *alloc_new_node_page(struct page *page, unsigned long node); + + +int madvise_common(struct task_struct *task, struct mm_struct *mm, + unsigned long start, size_t len_in, int behavior); #endif /* __MM_INTERNAL_H */ diff --git a/mm/madvise.c b/mm/madvise.c index 0c901de531e4..4fa9dfc770bc 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -1005,7 +1005,7 @@ madvise_behavior_valid(int behavior) * @task could be a zombie leader if it calls sys_exit so accessing mm_struct * via task->mm is prohibited. Please use @mm instead of task->mm. */ -static int madvise_common(struct task_struct *task, struct mm_struct *mm, +int madvise_common(struct task_struct *task, struct mm_struct *mm, unsigned long start, size_t len_in, int behavior) { unsigned long end, tmp; @@ -1103,6 +1103,7 @@ static int madvise_common(struct task_struct *task, struct mm_struct *mm, return error; } +EXPORT_SYMBOL_GPL(madvise_common); /* * The madvise(2) system call.