From patchwork Fri Mar 13 01:14:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 11435785 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 E96AB92A for ; Fri, 13 Mar 2020 01:14:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A9277205F4 for ; Fri, 13 Mar 2020 01:14:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="KG/wCXkQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9277205F4 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 6E2A76B0005; Thu, 12 Mar 2020 21:14:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6931E6B0006; Thu, 12 Mar 2020 21:14:37 -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 580886B0007; Thu, 12 Mar 2020 21:14:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 3DEB76B0005 for ; Thu, 12 Mar 2020 21:14:37 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E16EA83F9 for ; Fri, 13 Mar 2020 01:14:36 +0000 (UTC) X-FDA: 76588568952.26.tin86_b165f8e06400 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,jaewon31.kim@samsung.com,,RULES_HIT:30003:30012:30054:30070:30075,0,RBL:203.254.224.24:@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:22,LUA_SUMMARY:none X-HE-Tag: tin86_b165f8e06400 X-Filterd-Recvd-Size: 7894 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Mar 2020 01:14:36 +0000 (UTC) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200313011432epoutp01560587f0a1e4ee2de0d518514da4a11e~7uA-xETSP2433124331epoutp01e for ; Fri, 13 Mar 2020 01:14:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200313011432epoutp01560587f0a1e4ee2de0d518514da4a11e~7uA-xETSP2433124331epoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1584062072; bh=fzFOTyd4Kwji4bmqnDA3HgG3lu01uGhDeF3O7fUMvII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KG/wCXkQKFQQQgL9uh9+l8ZLbd3rS13hX+Savr6cs8CwZAEuAoIzgCHG7RGvJH9f2 5QYCLnkJnIrw/fPuuUdSqBXP+W4hknpSuvxeBqFV/65XD55ZFvRIWfJrSYmI8evJPU tbTjO/s1oyHQwZBfJpJd3bfSVy2tUQ8fIjGx9AEE= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20200313011432epcas1p44a713e2d3ce7173ff1ec24377f92ecb4~7uA-bAkuu0948609486epcas1p49; Fri, 13 Mar 2020 01:14:32 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.164]) by epsnrtp4.localdomain (Postfix) with ESMTP id 48dnm71Sw5zMqYkY; Fri, 13 Mar 2020 01:14:31 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 05.DD.48019.77EDA6E5; Fri, 13 Mar 2020 10:14:31 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200313011430epcas1p129e4033f12b9c02f71443e0b359a26e5~7uA94E3mw1118711187epcas1p1x; Fri, 13 Mar 2020 01:14:30 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200313011430epsmtrp2190fd3594586da0296370e470c8923b2~7uA90rXJk2955029550epsmtrp2j; Fri, 13 Mar 2020 01:14:30 +0000 (GMT) X-AuditID: b6c32a38-257ff7000001bb93-51-5e6ade77f290 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 1F.B5.04215.67EDA6E5; Fri, 13 Mar 2020 10:14:30 +0900 (KST) Received: from jaewon-linux.10.32.193.11 (unknown [10.253.104.82]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200313011430epsmtip21f1331bfc614ded8461c4a5ba88b3c7c~7uA9uEzuD2267422674epsmtip2M; Fri, 13 Mar 2020 01:14:30 +0000 (GMT) From: Jaewon Kim To: willy@infradead.org, walken@google.com, bp@suse.de, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com, Jaewon Kim Subject: [PATCH v2 1/2] mmap: remove inline of vm_unmapped_area Date: Fri, 13 Mar 2020 10:14:19 +0900 Message-Id: <20200313011420.15995-2-jaewon31.kim@samsung.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20200313011420.15995-1-jaewon31.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+Tw7Z0drdpiaLya6DjWYoW7N2SlcRUYd0MKIICNcBz1Mc7d2 NrMrVla61FKInBgsypSy22ZZlkEGdi/LLn+kXclS0kqzMrttHqP++z3v9zy8D9/3kZh8BI8i 8ywO3m7hTDQRIjl3VZUQv/7Z2iy19+gEpvZUI8FU7lUxe3xuxJR/6AtiOltqCeZZ42+c+VW1 hRn9VkvMJ9kLNd1S1uN1sr6GONY7WCVlr1ePStiKpmOI9d3axA55YzLIVaaUXJ7L4e0K3pJt zcmzGPV02nJDqkGXrNbEa2Yzs2iFhTPzenphekb8ojyTvxWtKOBMTv8ogxMEOnFuit3qdPCK XKvg0NO8Lcdk06htCQJnFpwWY0K21TxHo1bP1Pmda0y5A4c/4zavvHC4+o6kCLknuVAwCVQS FDe0SFwohJRT5xG4bnuQKAYRXHY9HxdfEJQcqJD8jTyoaMXEg1YEh0r2jYuvCPoOdhEBF0HN gA+eKtyFSDKcWg6v3WNjjHJC//vrWIDDqHlw2v0JD7CEmg7bv1cEBVhG6WHoVa80EAUqFg79 HrMHU3PB63uDB1YB1URAx5EiQiy0EG6W9Y9zGPRda5KKHAVDA62EGNiBoN/tQ6IoRtDtLUei SwvlZR1YYBtGqeBUS6I4ngoXRg8isXQoDAyX4WIhGZTskosWJRT3DOMiR8PPXz3jzMLD0tox llOVCO49Uu5DMTX/FngQOoYm8zbBbOQFjS3p/xfzorFvF8ecR5fuprchikT0RJl68tosOc4V CBvMbQhIjA6XGWKNWXJZDrdhI2+3GuxOEy+0IZ3/JiuxqIhsq/8TWxwGjW6mVqtlkpJnJeu0 dKTsZaYqS04ZOQefz/M23v43F0QGRxWh0xfrMvcUrlZNm1L4tPdazfGQV7jnxpndHSu6pw6u +5raVZ964rE0fzEjnH1bGZO+VLn/qf6F+8alZl30HdXn1fkf1eEni39sTtvmjH15pT26K7E5 tD1b1lrfWRe2JmxEueSmMvJyCbWg/3ba/ebqUkfctyeqyNiIZVs73ynu5+18v7KJlgi5nCYO swvcHzA13T+MAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrALMWRmVeSWpSXmKPExsWy7bCSvG7Zvaw4g88zpS3mrF/DZjGxX9Oi e/NMRove96+YLC7vmsNmcW/Nf1aLf5NqLX7/mMPmwOGxc9Zddo8Fm0o9Nq/Q8tj0aRK7x4kZ v1k8+rasYvTYfLra4/MmuQCOKC6blNSczLLUIn27BK6Md4u/sBZsEqr4OuMsSwPjTP4uRk4O CQETiUt9e5m7GLk4hAR2M0r0zX/ACJGQkXhz/ilLFyMHkC0scfhwMUTNV0aJc0eWMIHUsAlo S7xfMIkVpEZEIFxi6vYKkDCzQKXEv9u3WEFsYQF7iQ0zP4LZLAKqEk2/+sBaeQVsJT4/eskO MV5eYuF/ZpAwp4CdxKbNT8HKhYBKWj/MYp/AyLeAkWEVo2RqQXFuem6xYYFRXmq5XnFibnFp Xrpecn7uJkZwOGpp7WA8cSL+EKMAB6MSD6+BWFacEGtiWXFl7iFGCQ5mJRHeePn0OCHelMTK qtSi/Pii0pzU4kOM0hwsSuK88vnHIoUE0hNLUrNTUwtSi2CyTBycUg2M9bMnei14pWL48H/B DM6muBzPgE/zLh6dnPS1587UiV3MzV+eHdymoHejnOeEztftD/mZo/Jf/034ztz0cMG+hxca hHZYLH/dX8zt81lFZsLvfrWif8LXuYsnFV78495oPZ9vlzmP0sdjhyRn+dY25Dd+6POK+3H4 967j1QXR8g76/xYK2Yu4KbEUZyQaajEXFScCAHxD8/tDAgAA X-CMS-MailID: 20200313011430epcas1p129e4033f12b9c02f71443e0b359a26e5 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200313011430epcas1p129e4033f12b9c02f71443e0b359a26e5 References: <20200313011420.15995-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 --- include/linux/mm.h | 21 +-------------------- mm/mmap.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 52269e56c514..1cb01f4a83c9 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..eeaddb76286c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -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)