Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp319428ybb; Thu, 19 Mar 2020 22:59:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvi6CKLG2Yh4kSdHzAwhqdNdnoU8icCevyJB9ZKHLfwTxRtRSTGa7+R5fhR+Bid7pxXLobY X-Received: by 2002:a05:6808:a08:: with SMTP id n8mr5235913oij.91.1584683977328; Thu, 19 Mar 2020 22:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584683977; cv=none; d=google.com; s=arc-20160816; b=XbtDvfUpMFM3vY2hlqUmDM7zcTxJv4N9yMa2S667LxeBCvV71goeeJ9NckaXOta8P0 /FGYh6//rjzuMmccl0cFNPn5zAZ+scQjEgtsVq5dkow3W8KOSvOBr8UidNNg+LumroOa /USyrQsENk07ByG3DM+lRNMnsAU2kQg8PUjMWFHp1tRgG113FQqaUdpdq31PvFgicByo 3ERAdG9R9KtwoG5N5yewr+ZhVk7j4iIWoXTVAIfR0jLfxqJY1lLWWE7OqpdTSsydryAN c+WDiS8pFY3oy5AqLQNaiUrzYHxznB30iSHYCCgBpganDocU/m87tKgxbkMmPf1QRWMv 0vVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=vah53AmqrEMXcmGdds4iFjJJZRZ1yBycMR96OdrQFss=; b=QrOrPsYFlT9CyPRgb0PcE5HdcwplS/D+sQWlgJjfrWQpAvZhVzmxUfNLpydy4wOfMk 7byZJ7fm/UaPyRGcCZw+Om7Q8XkkgtC6b8jShcdHYlcW3JcPNo7ZkG4VAEMHbbGiTwMW PZK8d+JJx/t+datuEwQdtYlHKV2BbJpuRFPUizJnqNPPeqQoG7jBHCIFLEmk8WMqr1Ej sf6rJbl8W/5NxhjHcN4nWyRIahRk+KcQc8Qqv5RmRf5DDU0e+BHQvy8CEmbSloSkMuiX HmDD45MrRZvHbpV3bOzCtbJnzKY1IYWW+xRPEQ/hYjdQJRW24/tMIjsgMe52mZ1zQyS3 eOpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="L4+m/N1v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z65si2449926otb.197.2020.03.19.22.59.14; Thu, 19 Mar 2020 22:59:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="L4+m/N1v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbgCTF6q (ORCPT + 99 others); Fri, 20 Mar 2020 01:58:46 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:34453 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgCTF6o (ORCPT ); Fri, 20 Mar 2020 01:58:44 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200320055841epoutp0198ecfa65b0b171ddc1a22fa9b8119171~97aF2XeQ_0508505085epoutp01b for ; Fri, 20 Mar 2020 05:58:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200320055841epoutp0198ecfa65b0b171ddc1a22fa9b8119171~97aF2XeQ_0508505085epoutp01b 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-email 2.13.7 In-Reply-To: <20200320055823.27089-1-jaewon31.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRju2+VskxaHZfliZetAwWbLneb0VN6gC4eykOpPCq6THjbr7NLO ZtkFDG2ltbzQvJSRUVGEZUzRMqVYaZF0Q7qa9aOSFDXpalra5jHq3/O83/PwPLzfKxerDmKR 8hybi3XaGI7AwiRNtzU6XUmGK1P/4kM8VVNfh1FlJRrqSEM1oryf+kVUV0sNRr2pm5BS7aN9 Emq8fD81NlKDpSjo6yd6ZHSt3003XNTS/s/lMvpe1ZiEPtZ4CdENnXvpL/4oeuj0IJamSOcS LCyTzTrVrC3Lnp1jMycS6zaZVpqMcXpSRy6j4gm1jbGyicSq1DTdmhwu2I9Q5zKcOzhKY3ie iElKcNrdLlZtsfOuRIJ1ZHMOUu9YwjNW3m0zL8myW5eTev1SY1C5lbNUnXuBOTph99V6jygf XQkvRgo54LFwqOucpBiFyVX4NQTDH87LBPIZwfvLZ0UC+Y6guK9X9tfyc/iBVHhoQ1DpPYAE 8gPB044JaUiF4dHwqbZ8EofjFvCNvsVCWIy7YXDgnjiEZ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l7iFGCg1lJ hFc3HSjEm5JYWZValB9fVJqTWnyIUZqDRUmc92nesUghgfTEktTs1NSC1CKYLBMHp1QDI9tr N/st2yRn1L/KONy+MmtLT8/chRIBLo7T3stmG/nEB/8UMxc+dVbZ8wiXVe2h7Fz5zb/j1kR5 OK2TsdNsrTi54cTaKa+5rr97LvP9xNpbixSkIpW7pLl9X76/E30l33qW5P3TeRv6Nvxtc1kj ceSGKWOZhw0Tc9Xt67UrHwp/FztlUqn2U4mlOCPRUIu5qDgRAJfgYv1OAgAA X-CMS-MailID: 20200320055839epcas1p1a9b626b3afe8c22e36ff198f9eaeab2e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.13.7