From patchwork Fri Mar 20 05:58:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 11448443 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 1EC89139A for ; Fri, 20 Mar 2020 05:58:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D19CA2072D for ; Fri, 20 Mar 2020 05:58:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="L4+m/N1v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D19CA2072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 86CE36B0006; Fri, 20 Mar 2020 01:58:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 845586B000A; Fri, 20 Mar 2020 01:58:46 -0400 (EDT) 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 6CA9B6B0006; Fri, 20 Mar 2020 01:58:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 528CE6B0006 for ; Fri, 20 Mar 2020 01:58:46 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6F2F7180AD804 for ; Fri, 20 Mar 2020 05:58:46 +0000 (UTC) X-FDA: 76614686652.26.air10_86a8578275933 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,jaewon31.kim@samsung.com,,RULES_HIT:30003:30012:30054:30070:30075,0,RBL:203.254.224.25:@samsung.com:.lbl8.mailshell.net-62.18.1.2 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:23,LUA_SUMMARY:none X-HE-Tag: air10_86a8578275933 X-Filterd-Recvd-Size: 8728 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Mar 2020 05:58:45 +0000 (UTC) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200320055841epoutp02ec23b1239f74b6426a04300a69134c3b~97aF2GSIA2572025720epoutp02k for ; Fri, 20 Mar 2020 05:58:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200320055841epoutp02ec23b1239f74b6426a04300a69134c3b~97aF2GSIA2572025720epoutp02k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1584683921; bh=vah53AmqrEMXcmGdds4iFjJJZRZ1yBycMR96OdrQFss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L4+m/N1vLPPC/y3sKbGxeqEMB0d1Q86rQHfsAquA+ZiD8VciwTHiEiv8Jj7upa5fr HANwwu1l5eO6wu/U27daB1opvPbOBRNqqdbMpvaM8ioSkpH2xeCLiDsWBQoPcpNNHz HFQYRg+mxCWpPwsjJwI7q4AMiksxsze18qhobZis= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20200320055841epcas1p1e455875e4fed5952153773fb70cfa5c2~97aFfrhUK3072430724epcas1p1N; Fri, 20 Mar 2020 05:58:41 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.40.160]) by epsnrtp3.localdomain (Postfix) with ESMTP id 48kCkl6kSqzMqYkc; Fri, 20 Mar 2020 05:58:39 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 92.55.04145.F8B547E5; Fri, 20 Mar 2020 14:58:39 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200320055839epcas1p1a9b626b3afe8c22e36ff198f9eaeab2e~97aDnirGr3070730707epcas1p1L; Fri, 20 Mar 2020 05:58:39 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200320055839epsmtrp144ccc173c9c0336c189ed392df040879~97aDlv-in2644226442epsmtrp1F; Fri, 20 Mar 2020 05:58:39 +0000 (GMT) X-AuditID: b6c32a35-2a5ff70000001031-64-5e745b8f6b73 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F7.84.04024.F8B547E5; Fri, 20 Mar 2020 14:58:39 +0900 (KST) Received: from jaewon-linux.10.32.193.11 (unknown [10.253.104.82]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200320055839epsmtip16e07cca32822231a709d802fc0c31507~97aDaK3rs1022810228epsmtip1P; Fri, 20 Mar 2020 05:58:39 +0000 (GMT) From: Jaewon Kim To: willy@infradead.org, walken@google.com, bp@suse.de, akpm@linux-foundation.org, srostedt@vmware.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com, Jaewon Kim Subject: [PATCH v3 1/2] mmap: remove inline of vm_unmapped_area Date: Fri, 20 Mar 2020 14:58:22 +0900 Message-Id: <20200320055823.27089-2-jaewon31.kim@samsung.com> X-Mailer: git-send-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Xz3n7 kgvfvdfgBq7DtP7NExvenH/DWNf25eRoqjZ90b7NRdvmLPZWtA3nehakmh+u3vk1TmMauN1J SHgLQ2rFTp75A1U37nWYAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNLMWRmVeSWpSXmKPExsWy7bCSnG5/dEmcwdpfbBZz1q9hs5jYr2nR vXkmo0Xv+1dMFpd3zWGzuLfmP6vF0V8vWSz+Taq1+P1jDpsDp8fOWXfZPRZsKvXYvELLY9On SeweJ2b8ZvHo27KK0WPz6WqPz5vkPN7Nf8sWwBnFZZOSmpNZllqkb5fAlTFjyQ22gtMSFRvW tzE1MK4T6WLk5JAQMJH4+eEsaxcjF4eQwG5GiTctD1ghEjISb84/Zeli5ACyhSUOHy6GqPnK KHH701FGkBo2AW2J9wsmgdWLCORJtGx6CGYzC1RK/Lt9C8wWFrCXuHzkFlg9i4CqxKmpy1lA bF4BW4mpf+4zQcyXl1j4nxkkzClgJ3F9zyk2EFsIqGTuxGfMExj5FjAyrGKUTC0ozk3PLTYs MMxLLdcrTswtLs1L10vOz93ECA5SLc0djJeXxB9iFOBgVOLhndFWHCfEmlhWXJl7iFGCg1lJ hFc3HSjEm5JYWZValB9fVJqTWnyIUZqDRUmc92nesUghgfTEktTs1NSC1CKYLBMHp1QDI9tr N/st2yRn1L/KONy+MmtLT8/chRIBLo7T3stmG/nEB/8UMxc+dVbZ8wiXVe2h7Fz5zb/j1kR5 OK2TsdNsrTi54cTaKa+5rr97LvP9xNpbixSkIpW7pLl9X76/E30l33qW5P3TeRv6Nvxtc1kj ceSGKWOZhw0Tc9Xt67UrHwp/FztlUqn2U4mlOCPRUIu5qDgRAJfgYv1OAgAA X-CMS-MailID: 20200320055839epcas1p1a9b626b3afe8c22e36ff198f9eaeab2e X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200320055839epcas1p1a9b626b3afe8c22e36ff198f9eaeab2e References: <20200320055823.27089-1-jaewon31.kim@samsung.com> 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: In prepration for next patch remove inline of vm_unmapped_area and move code to mmap.c. There is no logical change. Also remove unmapped_area[_topdown] out of mm.h, there is no code calling to them. Signed-off-by: Jaewon Kim Reviewed-by: Vlastimil Babka --- v3: add static keyword v2: remove inline and move code to mmap.c --- include/linux/mm.h | 21 +-------------------- mm/mmap.c | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index c54fb96cb1e6..f4263993d053 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2364,26 +2364,7 @@ struct vm_unmapped_area_info { unsigned long align_offset; }; -extern unsigned long unmapped_area(struct vm_unmapped_area_info *info); -extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info); - -/* - * Search for an unmapped address range. - * - * We are looking for a range that: - * - does not intersect with any VMA; - * - is contained within the [low_limit, high_limit) interval; - * - is at least the desired size. - * - satisfies (begin_addr & align_mask) == (align_offset & align_mask) - */ -static inline unsigned long -vm_unmapped_area(struct vm_unmapped_area_info *info) -{ - if (info->flags & VM_UNMAPPED_AREA_TOPDOWN) - return unmapped_area_topdown(info); - else - return unmapped_area(info); -} +extern unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info); /* truncate.c */ extern void truncate_inode_pages(struct address_space *, loff_t); diff --git a/mm/mmap.c b/mm/mmap.c index d681a20eb4ea..ba990c20ecc2 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1848,7 +1848,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, return error; } -unsigned long unmapped_area(struct vm_unmapped_area_info *info) +static unsigned long unmapped_area(struct vm_unmapped_area_info *info) { /* * We implement the search by looking for an rbtree node that @@ -1951,7 +1951,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) return gap_start; } -unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) +static unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; @@ -2050,6 +2050,22 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) return gap_end; } +/* + * Search for an unmapped address range. + * + * We are looking for a range that: + * - does not intersect with any VMA; + * - is contained within the [low_limit, high_limit) interval; + * - is at least the desired size. + * - satisfies (begin_addr & align_mask) == (align_offset & align_mask) + */ +unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info) +{ + if (info->flags & VM_UNMAPPED_AREA_TOPDOWN) + return unmapped_area_topdown(info); + else + return unmapped_area(info); +} #ifndef arch_get_mmap_end #define arch_get_mmap_end(addr) (TASK_SIZE)