From patchwork Tue Feb 18 08:53:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11388053 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 B276E13A4 for ; Tue, 18 Feb 2020 08:54:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7509A24658 for ; Tue, 18 Feb 2020 08:54:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="qeBuXNoj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7509A24658 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 AABAD6B0007; Tue, 18 Feb 2020 03:54:16 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A81A46B0008; Tue, 18 Feb 2020 03:54:16 -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 9BE996B000A; Tue, 18 Feb 2020 03:54:16 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 845416B0007 for ; Tue, 18 Feb 2020 03:54:16 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 23C5C181AEF1F for ; Tue, 18 Feb 2020 08:54:16 +0000 (UTC) X-FDA: 76502636112.16.tin84_81baca4afe48 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=310eb5d20=sjpark@amazon.com,:akpm@linux-foundation.org:sjpark@amazon.de:acme@kernel.org:alexander.shishkin@linux.intel.com:amit@kernel.org:brendan.d.gregg@gmail.com:brendanhiggins@google.com:cai@lca.pw:colin.king@canonical.com:corbet@lwn.net:dwmw@amazon.com:jolsa@redhat.com:kirill@shutemov.name:mark.rutland@arm.com:mgorman@suse.de:minchan@kernel.org:mingo@redhat.com:namhyung@kernel.org:peterz@infradead.org:rdunlap@infradead.org:rostedt@goodmis.org:shuah@kernel.org:sj38.park@gmail.com:vdavydov.dev@gmail.com::linux-doc@vger.kernel.org:linux-kernel@vger.kernel.org,RULES_HIT:30012:30054:30064,0,RBL:52.95.49.90:@amazon.com:.lbl8.mailshell.net-62.18.0.100 64.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:24,LUA_SUMMARY:none X-HE-Tag: tin84_81baca4afe48 X-Filterd-Recvd-Size: 4493 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Feb 2020 08:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1582016056; x=1613552056; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=kAdTeVn39NF6MtyWxbSfFrMuEluavNfxQ8uqZzEFpes=; b=qeBuXNojWCRUNrG8QTE2trrb2KmSzw/aIgvJ+SxUacaPLvyNiX9kiJSP +CKhBrG+Hcai5VUrvNromg1GOuLsHixwfuLacRjh3ySPS9zJlcfPO1IGg he3ZN48e2zXz4PkuEsHoeDFWpRe2UylVoT36fjSSYnetDvoH3ChD2oMAN 4=; IronPort-SDR: Pb82G17sW4eGRVbXOfAxd5GeDDF8+bHfbeUvAjRbHWBmyYBUQ4VQ1EY4aFZgLXXnxzxqyNxvvG tWGVo+pHZmeg== X-IronPort-AV: E=Sophos;i="5.70,456,1574121600"; d="scan'208";a="16791750" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 18 Feb 2020 08:54:04 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (Postfix) with ESMTPS id 52519A259C; Tue, 18 Feb 2020 08:53:55 +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, 18 Feb 2020 08:53:55 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.108) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 18 Feb 2020 08:53:45 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v2 1/4] mm/madvise: Export madvise_common() to mm internal code Date: Tue, 18 Feb 2020 09:53:06 +0100 Message-ID: <20200218085309.18346-2-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200218085309.18346-1-sjpark@amazon.com> References: <20200218085309.18346-1-sjpark@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.43.160.108] X-ClientProxiedBy: EX13D10UWB004.ant.amazon.com (10.43.161.121) 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.