linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	David Rientjes <rientjes@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Christoph Lameter <cl@linux.com>,
	Behan Webster <behanw@converseincode.com>
Subject: Re: [PATCH] slab: Remove unnecessary __builtin_constant_p()
Date: Wed, 24 Apr 2013 10:31:40 +0300	[thread overview]
Message-ID: <CAOJsxLEFaAtKEvN4cRSDj7Pao5gbHv7K9fO0REhhhbsmUbgbmg@mail.gmail.com> (raw)
In-Reply-To: <20130422141621.384eb93a6a8f3d441cd1a991@linux-foundation.org>

Hello,

On Tue, Apr 23, 2013 at 12:16 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> The patch made index_of() weaker!
>
> It's probably all a bit academic, given that linux-next does
>
> -/*
> - * This function must be completely optimized away if a constant is passed to
> - * it.  Mostly the same as what is in linux/slab.h except it returns an index.
> - */
> -static __always_inline int index_of(const size_t size)
> -{
> -       extern void __bad_size(void);
> -
> -       if (__builtin_constant_p(size)) {
> -               int i = 0;
> -
> -#define CACHE(x) \
> -       if (size <=x) \
> -               return i; \
> -       else \
> -               i++;
> -#include <linux/kmalloc_sizes.h>
> -#undef CACHE
> -               __bad_size();
> -       } else
> -               __bad_size();
> -       return 0;
> -}
> -

Yup, Christoph nuked it in the following commit:

https://git.kernel.org/cgit/linux/kernel/git/penberg/linux.git/commit/?h=slab/next&id=2c59dd6544212faa5ce761920d2251f4152f408d

                        Pekka

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-04-24  7:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17 19:09 Steven Rostedt
2013-04-18  0:03 ` David Rientjes
2013-04-22 20:44   ` Andrew Morton
2013-04-22 20:58     ` Steven Rostedt
2013-04-22 21:16       ` Andrew Morton
2013-04-22 23:15         ` Steven Rostedt
2013-04-24  7:31         ` Pekka Enberg [this message]
2013-04-23  5:06       ` Behan Webster
2013-04-18  0:15 ` Will Huck
2013-04-18  0:32   ` David Rientjes
2013-04-18 10:24     ` Borislav Petkov

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=CAOJsxLEFaAtKEvN4cRSDj7Pao5gbHv7K9fO0REhhhbsmUbgbmg@mail.gmail.com \
    --to=penberg@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=behanw@converseincode.com \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox