From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF5D0C4CECE for ; Fri, 13 Mar 2020 10:36:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 64F8D206EB for ; Fri, 13 Mar 2020 10:36:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64F8D206EB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A6E106B0005; Fri, 13 Mar 2020 06:36:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F6E46B0006; Fri, 13 Mar 2020 06:36:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E6D26B0007; Fri, 13 Mar 2020 06:36:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 73D786B0005 for ; Fri, 13 Mar 2020 06:36:35 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 27FE4499606 for ; Fri, 13 Mar 2020 10:36:35 +0000 (UTC) X-FDA: 76589985150.18.kiss40_73a5e5c88a908 X-HE-Tag: kiss40_73a5e5c88a908 X-Filterd-Recvd-Size: 3895 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Mar 2020 10:36:34 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 425BEAC53; Fri, 13 Mar 2020 10:36:32 +0000 (UTC) Subject: Re: [PATCH v2 1/2] mmap: remove inline of vm_unmapped_area To: Jaewon Kim , 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 References: <20200313011420.15995-1-jaewon31.kim@samsung.com> <20200313011420.15995-2-jaewon31.kim@samsung.com> From: Vlastimil Babka Message-ID: <30e2d9c4-33fd-3e13-ce3d-de5099d48b18@suse.cz> Date: Fri, 13 Mar 2020 11:36:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200313011420.15995-2-jaewon31.kim@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: On 3/13/20 2:14 AM, Jaewon Kim wrote: > 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 Assuming the 'static' is added as Andrew pointed out, 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) >