All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Ghiti <alex@ghiti.fr>
To: Helge Deller <deller@gmx.de>
Cc: "James E . J . Bottomley" <james.bottomley@hansenpartnership.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>,
	"David S . Miller" <davem@davemloft.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH RESEND 6/8] parisc: Use mmap_base, not mmap_legacy_base, as low_limit for bottom-up mmap
Date: Wed, 26 Jun 2019 05:20:51 +0000	[thread overview]
Message-ID: <7fb32983-3444-0747-4e5f-812d1b4d84c2@ghiti.fr> (raw)
In-Reply-To: <438124ff-6838-7ced-044c-ca57a6b9cc91@gmx.de>

On 6/25/19 10:09 AM, Helge Deller wrote:
> On 20.06.19 07:03, Alexandre Ghiti wrote:
>> Bottom-up mmap scheme is used twice:
>>
>> - for legacy mode, in which mmap_legacy_base and mmap_base are equal.
>>
>> - in case of mmap failure in top-down mode, where there is no need to go
>> through the whole address space again for the bottom-up fallback: the goal
>> of this fallback is to find, as a last resort, space between the top-down
>> mmap base and the stack, which is the only place not covered by the
>> top-down mmap.
>>
>> Then this commit removes the usage of mmap_legacy_base field from parisc
>> code.
>>
>> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> Boot-tested on parisc and seems to work nicely, thus:
>
> Acked-by: Helge Deller <deller@gmx.de>

Thanks Helge,

Alex

>
> Helge
>
>
>
>> ---
>>   arch/parisc/kernel/sys_parisc.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
>> index 5d458a44b09c..e987f3a8eb0b 100644
>> --- a/arch/parisc/kernel/sys_parisc.c
>> +++ b/arch/parisc/kernel/sys_parisc.c
>> @@ -119,7 +119,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
>>
>>   	info.flags = 0;
>>   	info.length = len;
>> -	info.low_limit = mm->mmap_legacy_base;
>> +	info.low_limit = mm->mmap_base;
>>   	info.high_limit = mmap_upper_limit(NULL);
>>   	info.align_mask = last_mmap ? (PAGE_MASK & (SHM_COLOUR - 1)) : 0;
>>   	info.align_offset = shared_align_offset(last_mmap, pgoff);
>> @@ -240,13 +240,11 @@ static unsigned long mmap_legacy_base(void)
>>    */
>>   void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack)
>>   {
>> -	mm->mmap_legacy_base = mmap_legacy_base();
>> -	mm->mmap_base = mmap_upper_limit(rlim_stack);
>> -
>>   	if (mmap_is_legacy()) {
>> -		mm->mmap_base = mm->mmap_legacy_base;
>> +		mm->mmap_base = mmap_legacy_base();
>>   		mm->get_unmapped_area = arch_get_unmapped_area;
>>   	} else {
>> +		mm->mmap_base = mmap_upper_limit(rlim_stack);
>>   		mm->get_unmapped_area = arch_get_unmapped_area_topdown;
>>   	}
>>   }
>>

WARNING: multiple messages have this Message-ID (diff)
From: Alex Ghiti <alex@ghiti.fr>
To: Helge Deller <deller@gmx.de>
Cc: "James E . J . Bottomley" <james.bottomley@hansenpartnership.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>,
	"David S . Miller" <davem@davemloft.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH RESEND 6/8] parisc: Use mmap_base, not mmap_legacy_base, as low_limit for bottom-up mmap
Date: Wed, 26 Jun 2019 01:20:51 -0400	[thread overview]
Message-ID: <7fb32983-3444-0747-4e5f-812d1b4d84c2@ghiti.fr> (raw)
In-Reply-To: <438124ff-6838-7ced-044c-ca57a6b9cc91@gmx.de>

On 6/25/19 10:09 AM, Helge Deller wrote:
> On 20.06.19 07:03, Alexandre Ghiti wrote:
>> Bottom-up mmap scheme is used twice:
>>
>> - for legacy mode, in which mmap_legacy_base and mmap_base are equal.
>>
>> - in case of mmap failure in top-down mode, where there is no need to go
>> through the whole address space again for the bottom-up fallback: the goal
>> of this fallback is to find, as a last resort, space between the top-down
>> mmap base and the stack, which is the only place not covered by the
>> top-down mmap.
>>
>> Then this commit removes the usage of mmap_legacy_base field from parisc
>> code.
>>
>> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> Boot-tested on parisc and seems to work nicely, thus:
>
> Acked-by: Helge Deller <deller@gmx.de>

Thanks Helge,

Alex

>
> Helge
>
>
>
>> ---
>>   arch/parisc/kernel/sys_parisc.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
>> index 5d458a44b09c..e987f3a8eb0b 100644
>> --- a/arch/parisc/kernel/sys_parisc.c
>> +++ b/arch/parisc/kernel/sys_parisc.c
>> @@ -119,7 +119,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
>>
>>   	info.flags = 0;
>>   	info.length = len;
>> -	info.low_limit = mm->mmap_legacy_base;
>> +	info.low_limit = mm->mmap_base;
>>   	info.high_limit = mmap_upper_limit(NULL);
>>   	info.align_mask = last_mmap ? (PAGE_MASK & (SHM_COLOUR - 1)) : 0;
>>   	info.align_offset = shared_align_offset(last_mmap, pgoff);
>> @@ -240,13 +240,11 @@ static unsigned long mmap_legacy_base(void)
>>    */
>>   void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack)
>>   {
>> -	mm->mmap_legacy_base = mmap_legacy_base();
>> -	mm->mmap_base = mmap_upper_limit(rlim_stack);
>> -
>>   	if (mmap_is_legacy()) {
>> -		mm->mmap_base = mm->mmap_legacy_base;
>> +		mm->mmap_base = mmap_legacy_base();
>>   		mm->get_unmapped_area = arch_get_unmapped_area;
>>   	} else {
>> +		mm->mmap_base = mmap_upper_limit(rlim_stack);
>>   		mm->get_unmapped_area = arch_get_unmapped_area_topdown;
>>   	}
>>   }
>>

  reply	other threads:[~2019-06-26  5:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19  5:38 [PATCH RESEND 0/8] Fix mmap base in bottom-up mmap Alexandre Ghiti
2019-06-19  5:38 ` Alexandre Ghiti
2019-06-19  5:42 ` Alexandre Ghiti
2019-06-19  5:42   ` Alexandre Ghiti
2019-06-19  5:42   ` [PATCH RESEND 1/8] s390: Start fallback of top-down mmap at mm->mmap_base Alexandre Ghiti
2019-06-19  5:42     ` Alexandre Ghiti
2019-06-19  5:54     ` Alex Ghiti
2019-06-19  5:54       ` Alex Ghiti
2019-06-20  5:03 ` [PATCH RESEND 0/8] Fix mmap base in bottom-up mmap Alexandre Ghiti
2019-06-20  5:03   ` Alexandre Ghiti
2019-06-20  5:03   ` [PATCH RESEND 1/8] s390: Start fallback of top-down mmap at mm->mmap_base Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-06-20  5:03   ` [PATCH RESEND 2/8] sh: " Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-06-20  5:03   ` [PATCH RESEND 3/8] sparc: " Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-06-20  5:03   ` [PATCH RESEND 4/8] x86, hugetlbpage: " Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-06-20  5:03   ` [PATCH RESEND 5/8] mm: Start fallback " Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-06-20  5:03   ` [PATCH RESEND 6/8] parisc: Use mmap_base, not mmap_legacy_base, as low_limit for bottom-up mmap Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-06-25 14:09     ` Helge Deller
2019-06-25 14:09       ` Helge Deller
2019-06-26  5:20       ` Alex Ghiti [this message]
2019-06-26  5:20         ` Alex Ghiti
2019-06-20  5:03   ` [PATCH RESEND 7/8] x86: Use mmap_*base, not mmap_*legacy_base, " Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-06-20  5:03   ` [PATCH RESEND 8/8] mm: Remove mmap_legacy_base and mmap_compat_legacy_code fields from mm_struct Alexandre Ghiti
2019-06-20  5:03     ` Alexandre Ghiti
2019-07-30  6:12   ` [PATCH RESEND 0/8] Fix mmap base in bottom-up mmap Alexandre Ghiti
2019-07-30  6:12     ` Alexandre Ghiti
2019-08-26  7:34   ` Alexandre Ghiti
2019-08-26  7:34     ` Alexandre Ghiti
2019-08-26 22:37     ` Helge Deller
2019-08-26 22:37       ` Helge Deller
2019-08-28  4:53       ` Alex Ghiti
2019-08-28  4:53         ` Alex Ghiti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fb32983-3444-0747-4e5f-812d1b4d84c2@ghiti.fr \
    --to=alex@ghiti.fr \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@de.ibm.com \
    --cc=bp@alien8.de \
    --cc=dalias@libc.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.