* [2.6 patch] kernel/cgroup.c: make 2 functions static
@ 2007-10-24 16:23 Adrian Bunk
2007-10-24 16:32 ` Paul Menage
2007-10-24 16:46 ` Paul Menage
0 siblings, 2 replies; 4+ messages in thread
From: Adrian Bunk @ 2007-10-24 16:23 UTC (permalink / raw)
To: Paul Menage, Paul Jackson; +Cc: linux-kernel
cgroup_is_releasable() and notify_on_release() should be static,
not global inline.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
kernel/cgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
626d10ec224de07fc7906b0aa82e035e153709ce
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 5987dcc..fec1726 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -143,7 +143,7 @@ enum {
ROOT_NOPREFIX, /* mounted subsystems have no named prefix */
};
-inline int cgroup_is_releasable(const struct cgroup *cgrp)
+static int cgroup_is_releasable(const struct cgroup *cgrp)
{
const int bits =
(1 << CGRP_RELEASABLE) |
@@ -151,7 +151,7 @@ inline int cgroup_is_releasable(const struct cgroup *cgrp)
return (cgrp->flags & bits) == bits;
}
-inline int notify_on_release(const struct cgroup *cgrp)
+static int notify_on_release(const struct cgroup *cgrp)
{
return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [2.6 patch] kernel/cgroup.c: make 2 functions static
2007-10-24 16:23 [2.6 patch] kernel/cgroup.c: make 2 functions static Adrian Bunk
@ 2007-10-24 16:32 ` Paul Menage
2007-10-24 16:41 ` Adrian Bunk
2007-10-24 16:46 ` Paul Menage
1 sibling, 1 reply; 4+ messages in thread
From: Paul Menage @ 2007-10-24 16:32 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Paul Jackson, linux-kernel
On 10/24/07, Adrian Bunk <bunk@kernel.org> wrote:
> cgroup_is_releasable() and notify_on_release() should be static,
> not global inline.
>
They seem like they could be usefully static inline - or will the
compiler inline them anyway since they're simple enough?
Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [2.6 patch] kernel/cgroup.c: make 2 functions static
2007-10-24 16:32 ` Paul Menage
@ 2007-10-24 16:41 ` Adrian Bunk
0 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2007-10-24 16:41 UTC (permalink / raw)
To: Paul Menage; +Cc: Paul Jackson, linux-kernel
On Wed, Oct 24, 2007 at 09:32:26AM -0700, Paul Menage wrote:
> On 10/24/07, Adrian Bunk <bunk@kernel.org> wrote:
> > cgroup_is_releasable() and notify_on_release() should be static,
> > not global inline.
> >
>
> They seem like they could be usefully static inline - or will the
> compiler inline them anyway since they're simple enough?
gcc [1] will currently always inline a static cgroup_is_releasable() as
long as it only has one caller.
Besides this, the compiler has the opportunity to inline all static
functions when it thinks this makes sense, and it can base it's decision
on things like whether we gave it -Os/-O2 and which CPU it's compiling
for.
Long term manually forced "inline" has negative effects since functions
tend to become larger and more often called without the "inline"
removed, so don't use it unless there is a visible performance
difference.
> Paul
cu
Adrian
[1] I'm talking about gcc 4
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [2.6 patch] kernel/cgroup.c: make 2 functions static
2007-10-24 16:23 [2.6 patch] kernel/cgroup.c: make 2 functions static Adrian Bunk
2007-10-24 16:32 ` Paul Menage
@ 2007-10-24 16:46 ` Paul Menage
1 sibling, 0 replies; 4+ messages in thread
From: Paul Menage @ 2007-10-24 16:46 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Paul Jackson, linux-kernel
On 10/24/07, Adrian Bunk <bunk@kernel.org> wrote:
> cgroup_is_releasable() and notify_on_release() should be static,
> not global inline.
>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Paul Menage <menage@google.com>
>
> ---
>
> kernel/cgroup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> 626d10ec224de07fc7906b0aa82e035e153709ce
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 5987dcc..fec1726 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -143,7 +143,7 @@ enum {
> ROOT_NOPREFIX, /* mounted subsystems have no named prefix */
> };
>
> -inline int cgroup_is_releasable(const struct cgroup *cgrp)
> +static int cgroup_is_releasable(const struct cgroup *cgrp)
> {
> const int bits =
> (1 << CGRP_RELEASABLE) |
> @@ -151,7 +151,7 @@ inline int cgroup_is_releasable(const struct cgroup *cgrp)
> return (cgrp->flags & bits) == bits;
> }
>
> -inline int notify_on_release(const struct cgroup *cgrp)
> +static int notify_on_release(const struct cgroup *cgrp)
> {
> return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
> }
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-24 16:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 16:23 [2.6 patch] kernel/cgroup.c: make 2 functions static Adrian Bunk
2007-10-24 16:32 ` Paul Menage
2007-10-24 16:41 ` Adrian Bunk
2007-10-24 16:46 ` Paul Menage
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.