[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37997658-a990-51ba-94e2-b022f7cf5904@csgroup.eu>
Date: Thu, 16 Dec 2021 14:25:36 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Nicholas Piggin <npiggin@...il.com>,
"alex@...ti.fr" <alex@...ti.fr>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Michael Ellerman <mpe@...erman.id.au>,
Paul Mackerras <paulus@...ba.org>
CC: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH v4 06/10] powerpc/mm: Use generic_get_unmapped_area() and
call it from arch_get_unmapped_area()
Le 09/12/2021 à 10:50, Nicholas Piggin a écrit :
> Excerpts from Christophe Leroy's message of December 9, 2021 3:18 am:
>> Use the generic version of arch_get_unmapped_area() which
>> is now available at all time instead of its copy
>> radix__arch_get_unmapped_area()
>>
>> Instead of setting mm->get_unmapped_area() to either
>> arch_get_unmapped_area() or generic_get_unmapped_area(),
>> always set it to arch_get_unmapped_area() and call
>> generic_get_unmapped_area() from there when radix is enabled.
>>
>> Do the same with radix__arch_get_unmapped_area_topdown()
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
>> ---
>> arch/powerpc/mm/mmap.c | 127 ++---------------------------------------
>> 1 file changed, 6 insertions(+), 121 deletions(-)
>>
>> diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
>> index 9b0d6e395bc0..46781d0103d1 100644
>> --- a/arch/powerpc/mm/mmap.c
>> +++ b/arch/powerpc/mm/mmap.c
>> @@ -81,115 +81,15 @@ static inline unsigned long mmap_base(unsigned long rnd,
>> }
>>
>> #ifdef HAVE_ARCH_UNMAPPED_AREA
>> -#ifdef CONFIG_PPC_RADIX_MMU
>> -/*
>> - * Same function as generic code used only for radix, because we don't need to overload
>> - * the generic one. But we will have to duplicate, because hash select
>> - * HAVE_ARCH_UNMAPPED_AREA
>> - */
>> -static unsigned long
>> -radix__arch_get_unmapped_area(struct file *filp, unsigned long addr,
>> - unsigned long len, unsigned long pgoff,
>> - unsigned long flags)
>> -{
>> - struct mm_struct *mm = current->mm;
>> - struct vm_area_struct *vma;
>> - int fixed = (flags & MAP_FIXED);
>> - unsigned long high_limit;
>> - struct vm_unmapped_area_info info;
>> -
>> - high_limit = DEFAULT_MAP_WINDOW;
>> - if (addr >= high_limit || (fixed && (addr + len > high_limit)))
>> - high_limit = TASK_SIZE;
>
> Does 64s radix need to define arch_get_mmap_end() to do the above now?
>
> Otherwise great to consolidate this with core code, nice patch.
>
Yes it needs arch_get_mmap_end() and also arch_get_mmap_base().
I added it in v5, taking also suggestion from Michael.
Thanks
Christophe
Powered by blists - more mailing lists