Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600989 > unrolled thread

[PATCH 7/7] Remove expensive WARN_ON in pagefault_disabled_dec

Started byAndi Kleen <andi@firstfloor.org>
First post2017-03-15 03:20 +0100
Last post2017-03-15 22:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 7/7] Remove expensive WARN_ON in pagefault_disabled_dec Andi Kleen <andi@firstfloor.org> - 2017-03-15 03:20 +0100
    Re: [PATCH 7/7] Remove expensive WARN_ON in pagefault_disabled_dec Andrew Morton <akpm@linux-foundation.org> - 2017-03-15 22:50 +0100

#1600989 — [PATCH 7/7] Remove expensive WARN_ON in pagefault_disabled_dec

FromAndi Kleen <andi@firstfloor.org>
Date2017-03-15 03:20 +0100
Subject[PATCH 7/7] Remove expensive WARN_ON in pagefault_disabled_dec
Message-ID<tl6HD-OK-5@gated-at.bofh.it>
From: Andi Kleen <ak@linux.intel.com>

pagefault_disabled_dec is frequently used inline, and it has a WARN_ON
for underflow that expands to about 6.5k of extra code. The warning
doesn't seem to be that useful and worth so much code so remove it.

If it was needed could make it depending on some debug kernel option.

Saves ~6.5k in my kernel

   text    data     bss     dec     hex filename
9039417 5367568 11116544        25523529        1857549 vmlinux-before-pf
9032805 5367568 11116544        25516917        1855b75 vmlinux-pf

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/uaccess.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index f30c187ed785..b691aad918fb 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -12,7 +12,6 @@ static __always_inline void pagefault_disabled_inc(void)
 static __always_inline void pagefault_disabled_dec(void)
 {
 	current->pagefault_disabled--;
-	WARN_ON(current->pagefault_disabled < 0);
 }
 
 /*
-- 
2.9.3

[toc] | [next] | [standalone]


#1601764

FromAndrew Morton <akpm@linux-foundation.org>
Date2017-03-15 22:50 +0100
Message-ID<tloXU-59Y-21@gated-at.bofh.it>
In reply to#1600989
On Tue, 14 Mar 2017 19:14:31 -0700 Andi Kleen <andi@firstfloor.org> wrote:

> From: Andi Kleen <ak@linux.intel.com>
> 
> pagefault_disabled_dec is frequently used inline, and it has a WARN_ON
> for underflow that expands to about 6.5k of extra code. The warning
> doesn't seem to be that useful and worth so much code so remove it.
> 
> If it was needed could make it depending on some debug kernel option.
> 
> Saves ~6.5k in my kernel
> 
>    text    data     bss     dec     hex filename
> 9039417 5367568 11116544        25523529        1857549 vmlinux-before-pf
> 9032805 5367568 11116544        25516917        1855b75 vmlinux-pf
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  include/linux/uaccess.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
> index f30c187ed785..b691aad918fb 100644
> --- a/include/linux/uaccess.h
> +++ b/include/linux/uaccess.h
> @@ -12,7 +12,6 @@ static __always_inline void pagefault_disabled_inc(void)
>  static __always_inline void pagefault_disabled_dec(void)
>  {
>  	current->pagefault_disabled--;
> -	WARN_ON(current->pagefault_disabled < 0);
>  }

Fair enough.  We could switch to VM_WARN_ON but apparently even that is now
being enabled in some production systems, which somewhat defeats its
intent...

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web