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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA1A3C433EF for ; Thu, 9 Dec 2021 10:02:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A1006B0073; Thu, 9 Dec 2021 05:02:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 72A386B0074; Thu, 9 Dec 2021 05:02:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A37A6B0075; Thu, 9 Dec 2021 05:02:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id 4B7566B0073 for ; Thu, 9 Dec 2021 05:02:21 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0EFE18248076 for ; Thu, 9 Dec 2021 10:02:11 +0000 (UTC) X-FDA: 78897815262.13.DECDC25 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf11.hostedemail.com (Postfix) with ESMTP id 978C440007 for ; Thu, 9 Dec 2021 10:02:09 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id x5so5035325pfr.0 for ; Thu, 09 Dec 2021 02:02:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=5oVFdJaM2PcvUusC9hs7LeIc0YvFAbCJaVJ7FzBWJdM=; b=kFVc38vaTBxkwEMJdZmfRtbKqwkN31Wc5nZTgf5Fg20Ay116TKWw9FyZg0s8UM4FHP Fhnf+MIBC/ZO3ayNf/q4q51faWxqHALqjWZ0QbPLDwOLDBKLNe5Lct50J8ySCmzQF3dT c7qiLkroSDir7Ss0SGzdqv2Q5bn+IPHTtfKDkqW5UlWecpET9bftDMvgD9y7QY+6QqwK R7pksqgo416XTozyzHluRDszHwSQ8G9xdOQT4/a215mpHRcb+HCxTSrpSu0kCDpeJlYU pH1CoZRpCgHrcKaZUOnsEOyg7l3v8Z7RrCe9hV2h4VZG7XBy+95sq1+nrEYp7MUj4MtS eytg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=5oVFdJaM2PcvUusC9hs7LeIc0YvFAbCJaVJ7FzBWJdM=; b=DJY1OXpsOne+2ABSp4fV0+UwBa3pSuAwdpr1hKN2HgclgZWO6L8v8gTomnkccgFRIV WRfVX+VfFZ6P8hWEyHEMsL/TL5dJL8lrgtGc/4k9G7uWGH7jely3nWrAq5B1ul83I9By WQq/eYeIcRfTTjCy5ccZGl5v+TYT5FM05C2ceCr9+hs4WUfv+5zoR+mAML/+4cqBrGLv IUBH0YfN113xD2l/U8zFzo71ZxDZLROo/UXiM6v7KDgVd7N/yWmhnG6/YWZkDtdnsbsz VGWiVxMUS+Cej7QoZaiUpvnv/Kr7GSCcR665Z0NwrQBfbHxQLmqGex/GPEO7rX2WW18k sWyQ== X-Gm-Message-State: AOAM5317dYY/0hXlcKHxeOxx9b1RwERRhLwhKWeQF5GuT/6DV9q+2C+k nps8Pw4aJVRxscTyXWqbpyQ+AmzrlD4= X-Google-Smtp-Source: ABdhPJzy3TvVBy6QQSkTJFD+qdFCNy0Rp7564qrtzvh+bA8jUmTAU5XESi30JQgsDpF2u6x66E5wLA== X-Received: by 2002:a63:e34c:: with SMTP id o12mr27909026pgj.509.1639044129670; Thu, 09 Dec 2021 02:02:09 -0800 (PST) Received: from localhost (203-219-139-206.static.tpgi.com.au. [203.219.139.206]) by smtp.gmail.com with ESMTPSA id n6sm6176458pfa.28.2021.12.09.02.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 02:02:09 -0800 (PST) Date: Thu, 09 Dec 2021 20:02:03 +1000 From: Nicholas Piggin Subject: Re: [PATCH v4 07/10] powerpc/mm: Use generic_hugetlb_get_unmapped_area() To: "alex@ghiti.fr" , Benjamin Herrenschmidt , Christophe Leroy , Michael Ellerman , Paul Mackerras Cc: "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linuxppc-dev@lists.ozlabs.org" References: In-Reply-To: MIME-Version: 1.0 Message-Id: <1639043741.e2zqhea1ix.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 978C440007 X-Stat-Signature: 8ymij595mh9191n9zih5sjo5zhsaykj1 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kFVc38va; spf=pass (imf11.hostedemail.com: domain of npiggin@gmail.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1639044129-990717 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: Excerpts from Christophe Leroy's message of December 9, 2021 3:18 am: > Use the generic version of arch_hugetlb_get_unmapped_area() > which is now available at all time. >=20 > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/book3s/64/hugetlb.h | 4 -- > arch/powerpc/mm/book3s64/radix_hugetlbpage.c | 55 -------------------- > arch/powerpc/mm/hugetlbpage.c | 4 +- > 3 files changed, 1 insertion(+), 62 deletions(-) >=20 > diff --git a/arch/powerpc/include/asm/book3s/64/hugetlb.h b/arch/powerpc/= include/asm/book3s/64/hugetlb.h > index 12e150e615b7..b37a28f62cf6 100644 > --- a/arch/powerpc/include/asm/book3s/64/hugetlb.h > +++ b/arch/powerpc/include/asm/book3s/64/hugetlb.h > @@ -8,10 +8,6 @@ > */ > void radix__flush_hugetlb_page(struct vm_area_struct *vma, unsigned long= vmaddr); > void radix__local_flush_hugetlb_page(struct vm_area_struct *vma, unsigne= d long vmaddr); > -extern unsigned long > -radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, > - unsigned long len, unsigned long pgoff, > - unsigned long flags); > =20 > extern void radix__huge_ptep_modify_prot_commit(struct vm_area_struct *v= ma, > unsigned long addr, pte_t *ptep, > diff --git a/arch/powerpc/mm/book3s64/radix_hugetlbpage.c b/arch/powerpc/= mm/book3s64/radix_hugetlbpage.c > index 23d3e08911d3..d2fb776febb4 100644 > --- a/arch/powerpc/mm/book3s64/radix_hugetlbpage.c > +++ b/arch/powerpc/mm/book3s64/radix_hugetlbpage.c > @@ -41,61 +41,6 @@ void radix__flush_hugetlb_tlb_range(struct vm_area_str= uct *vma, unsigned long st > radix__flush_tlb_range_psize(vma->vm_mm, start, end, psize); > } > =20 > -/* > - * A vairant of hugetlb_get_unmapped_area doing topdown search > - * FIXME!! should we do as x86 does or non hugetlb area does ? > - * ie, use topdown or not based on mmap_is_legacy check ? > - */ > -unsigned long > -radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, > - unsigned long len, unsigned long pgoff, > - unsigned long flags) > -{ > - struct mm_struct *mm =3D current->mm; > - struct vm_area_struct *vma; > - struct hstate *h =3D hstate_file(file); > - int fixed =3D (flags & MAP_FIXED); > - unsigned long high_limit; > - struct vm_unmapped_area_info info; > - > - high_limit =3D DEFAULT_MAP_WINDOW; > - if (addr >=3D high_limit || (fixed && (addr + len > high_limit))) > - high_limit =3D TASK_SIZE; I wonder if generic hugetlb_get_unmapped_area needs to have the arch_get_mmap_end() added. arm64 has arch_get_mmap_end() and !HAVE_ARCH_HUGETLB_UNMAPPED_AREA so it looks like it has broken large address hint logic for hugetlbfs mappings? x86-64 defines their own and does the same hinting for normal and hugetlbfs mmap. If we had that and defied arch_get_mmap_end(), then this patch should work. Thanks, Nick