Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1568727ybh; Fri, 13 Mar 2020 03:38:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvfGNSmmaw/9rmdv7mZA6BeeUF76wNgcb82UBnSfqkvx6++fHvireY20+MallZE3LUC0JwZ X-Received: by 2002:a9d:3d65:: with SMTP id a92mr9690031otc.326.1584095921471; Fri, 13 Mar 2020 03:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584095921; cv=none; d=google.com; s=arc-20160816; b=S/LWfa1gMPZwbQUH+DawtEzxpOelkL8sYFiR7v2O3DmDwyiwjmeIzzUVa1f3o812U2 Vs5I6OH/YA51zQ+igQL7fGGR+BbXvPph6mhWPCKXnd+w0cvGJUwIJAbTMMf+1hsb7BsD FxsQUFo/yKYdI9uj59lNT42iGKE2U6A/zEMcqsp82swd2hvPrVBgith1yCedTho4XvTS 8QRstdsaVuClL3fJpBoHkVhCmQIoCdpAUbpZAJ3fds8ns4sr+JzmWLGTaFgmve8WWcbT spnBfy1KwtRc9QTLj46YyVqGczRkEudgGEUlMm+jFjXzBCWePkBic1zFQtau8sWj4q4j pYjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=JHjGOWyivYI7mbiESGBQ2fQG0c+ziiWaxAigj/1kSWw=; b=uFiaYxcxCcQGnZp7w6/CljzGuuQyiA0tQY3Rl+1Wt6ZIkf2Jy5ggaoTa9LSQdSz9eD V1UZTtT6SHEeeyA0CD+s4QXdaRDYdugJqDBm+0B71VC5MyBVmRydLrBKIqzMXP2TmZCr qSqjnMW16Lcd8PsAsT4Hnoa1jKSeXPe0DRvmHSsziOUbRNU9+Z37IFebNvanMBermffQ pKkPqfqV6FGJarRj0zKGrWMuXasGMk1mYcyTwVYxlhKtUQ0vult3Ba1R1giXLu84mtRd W+gpG5ymb0jEBbnIl8Nn2fp27MuDnDdmTeLT3Hd2odiYTPVHvA4VXULC0mVeN9aBqiO1 9Hdg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21si4388489otq.93.2020.03.13.03.38.28; Fri, 13 Mar 2020 03:38:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726479AbgCMKge (ORCPT + 99 others); Fri, 13 Mar 2020 06:36:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:44586 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgCMKge (ORCPT ); Fri, 13 Mar 2020 06:36:34 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) >