diff mbox

ARM: mm: Remove dead code in mem_init()

Message ID 1502700269-24384-3-git-send-email-vladimir.murzin@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladimir Murzin Aug. 14, 2017, 8:44 a.m. UTC
The code in question checks memory constrains to set default policy for
overcommit; however we support page size of 4K only thus condition is
always evaluated to false. Remove that dead code.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mm/init.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Vladimir Murzin Sept. 1, 2017, 10:35 a.m. UTC | #1
On 14/08/17 09:44, Vladimir Murzin wrote:
> The code in question checks memory constrains to set default policy for
> overcommit; however we support page size of 4K only thus condition is
> always evaluated to false. Remove that dead code.
>
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> ---
>  arch/arm/mm/init.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index ad80548..81d4482 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -580,16 +580,6 @@ void __init mem_init(void)
>       BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
>       BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE      > PAGE_OFFSET);
>  #endif
> -
> -     if (PAGE_SIZE >= 16384 && get_num_physpages() <= 128) {
> -             extern int sysctl_overcommit_memory;
> -             /*
> -              * On a machine this small we won't get
> -              * anywhere without overcommit, so turn
> -              * it on by default.
> -              */
> -             sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
> -     }
>  }
>
>  #ifdef CONFIG_STRICT_KERNEL_RWX
>

Ok for patch tracker?

Vladimir
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Russell King (Oracle) Sept. 1, 2017, 11:06 p.m. UTC | #2
On Fri, Sep 01, 2017 at 11:35:16AM +0100, Vladimir Murzin wrote:
> On 14/08/17 09:44, Vladimir Murzin wrote:
> > The code in question checks memory constrains to set default policy for
> > overcommit; however we support page size of 4K only thus condition is
> > always evaluated to false. Remove that dead code.
> >
> > Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> > ---
> >  arch/arm/mm/init.c | 10 ----------
> >  1 file changed, 10 deletions(-)
> >
> > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> > index ad80548..81d4482 100644
> > --- a/arch/arm/mm/init.c
> > +++ b/arch/arm/mm/init.c
> > @@ -580,16 +580,6 @@ void __init mem_init(void)
> >       BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
> >       BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE      > PAGE_OFFSET);
> >  #endif
> > -
> > -     if (PAGE_SIZE >= 16384 && get_num_physpages() <= 128) {
> > -             extern int sysctl_overcommit_memory;
> > -             /*
> > -              * On a machine this small we won't get
> > -              * anywhere without overcommit, so turn
> > -              * it on by default.
> > -              */
> > -             sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
> > -     }
> >  }
> >
> >  #ifdef CONFIG_STRICT_KERNEL_RWX
> >
> 
> Ok for patch tracker?

Yep.
diff mbox

Patch

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index ad80548..81d4482 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -580,16 +580,6 @@  void __init mem_init(void)
 	BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
 	BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE	> PAGE_OFFSET);
 #endif
-
-	if (PAGE_SIZE >= 16384 && get_num_physpages() <= 128) {
-		extern int sysctl_overcommit_memory;
-		/*
-		 * On a machine this small we won't get
-		 * anywhere without overcommit, so turn
-		 * it on by default.
-		 */
-		sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
-	}
 }
 
 #ifdef CONFIG_STRICT_KERNEL_RWX