* [PATCH] sched: add the inline keyword to the prototype.
@ 2011-11-15 18:16 Il Han
2011-11-16 7:28 ` Paul Turner
0 siblings, 1 reply; 6+ messages in thread
From: Il Han @ 2011-11-15 18:16 UTC (permalink / raw)
To: Paul Turner, Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel, Il Han
The prototype has to agree with the definition.
Add the inline keyword to the prototype also
Signed-off-by: Il Han <corone.il.han@gmail.com>
---
kernel/sched_fair.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 5c9e679..c7c93d2 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -306,7 +306,7 @@ find_matching_se(struct sched_entity **se, struct sched_entity **pse)
#endif /* CONFIG_FAIR_GROUP_SCHED */
-static void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
+static __always_inline void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
unsigned long delta_exec);
/**************************************************************
@@ -1052,7 +1052,7 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
__clear_buddies_skip(se);
}
-static void return_cfs_rq_runtime(struct cfs_rq *cfs_rq);
+static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq);
static void
dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] sched: add the inline keyword to the prototype.
2011-11-15 18:16 [PATCH] sched: add the inline keyword to the prototype Il Han
@ 2011-11-16 7:28 ` Paul Turner
2011-11-16 9:00 ` Peter Zijlstra
0 siblings, 1 reply; 6+ messages in thread
From: Paul Turner @ 2011-11-16 7:28 UTC (permalink / raw)
To: Il Han; +Cc: Ingo Molnar, Peter Zijlstra, linux-kernel
On 11/15/2011 10:16 AM, Il Han wrote:
> The prototype has to agree with the definition.
> Add the inline keyword to the prototype also
>
Hmm... this would then cause the prototypes to disagree in the
!CONFIG_CFS_BANDWIDTH case.
Can you update?
> Signed-off-by: Il Han<corone.il.han@gmail.com>
> ---
> kernel/sched_fair.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index 5c9e679..c7c93d2 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -306,7 +306,7 @@ find_matching_se(struct sched_entity **se, struct sched_entity **pse)
>
> #endif /* CONFIG_FAIR_GROUP_SCHED */
>
> -static void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
> +static __always_inline void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
> unsigned long delta_exec);
>
> /**************************************************************
> @@ -1052,7 +1052,7 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
> __clear_buddies_skip(se);
> }
>
> -static void return_cfs_rq_runtime(struct cfs_rq *cfs_rq);
> +static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq);
>
> static void
> dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sched: add the inline keyword to the prototype.
2011-11-16 7:28 ` Paul Turner
@ 2011-11-16 9:00 ` Peter Zijlstra
2011-11-16 18:40 ` Paul Turner
0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2011-11-16 9:00 UTC (permalink / raw)
To: Paul Turner; +Cc: Il Han, Ingo Molnar, linux-kernel
On Tue, 2011-11-15 at 23:28 -0800, Paul Turner wrote:
> On 11/15/2011 10:16 AM, Il Han wrote:
> > The prototype has to agree with the definition.
> > Add the inline keyword to the prototype also
> >
>
> Hmm... this would then cause the prototypes to disagree in the
> !CONFIG_CFS_BANDWIDTH case.
I'm very sure I've compiled a lot of kernels yesterday with various
permutations including FAIR_GROUP && !CFS_BANDWIDTH and I'm also very
sure I haven't actually seen any complaints like this.
It this some new fangled GCC 'feature'? I'm currently still on 4.5 which
admittedly is somewhat stale.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] sched: add the inline keyword to the prototype.
@ 2011-11-16 12:45 Il Han
2011-11-16 13:06 ` Peter Zijlstra
0 siblings, 1 reply; 6+ messages in thread
From: Il Han @ 2011-11-16 12:45 UTC (permalink / raw)
To: Paul Turner, Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel, Il Han
The prototype has to agree with the definition.
Add the inline keyword to the prototype also.
Signed-off-by: Il Han <corone.il.han@gmail.com>
---
kernel/sched_fair.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 7e51b5b..74eeffe 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -306,7 +306,7 @@ find_matching_se(struct sched_entity **se, struct sched_entity **pse)
#endif /* CONFIG_FAIR_GROUP_SCHED */
-static void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
+static __always_inline void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
unsigned long delta_exec);
/**************************************************************
@@ -1065,7 +1065,7 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
__clear_buddies_skip(se);
}
-static void return_cfs_rq_runtime(struct cfs_rq *cfs_rq);
+static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq);
static void
dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
@@ -1831,11 +1831,11 @@ static void check_cfs_rq_runtime(struct cfs_rq *cfs_rq)
throttle_cfs_rq(cfs_rq);
}
#else
-static void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
+static __always_inline void account_cfs_rq_runtime(struct cfs_rq *cfs_rq,
unsigned long delta_exec) {}
static void check_cfs_rq_runtime(struct cfs_rq *cfs_rq) {}
static void check_enqueue_throttle(struct cfs_rq *cfs_rq) {}
-static void return_cfs_rq_runtime(struct cfs_rq *cfs_rq) {}
+static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq) {}
static inline int cfs_rq_throttled(struct cfs_rq *cfs_rq)
{
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] sched: add the inline keyword to the prototype.
2011-11-16 12:45 Il Han
@ 2011-11-16 13:06 ` Peter Zijlstra
0 siblings, 0 replies; 6+ messages in thread
From: Peter Zijlstra @ 2011-11-16 13:06 UTC (permalink / raw)
To: Il Han; +Cc: Paul Turner, Ingo Molnar, linux-kernel
On Wed, 2011-11-16 at 21:45 +0900, Il Han wrote:
> The prototype has to agree with the definition.
> Add the inline keyword to the prototype also.
Is this something gcc-4.6 wants or so? I guess I should go build new
compilers, again.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sched: add the inline keyword to the prototype.
2011-11-16 9:00 ` Peter Zijlstra
@ 2011-11-16 18:40 ` Paul Turner
0 siblings, 0 replies; 6+ messages in thread
From: Paul Turner @ 2011-11-16 18:40 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Il Han, Ingo Molnar, linux-kernel
On 11/16/2011 01:00 AM, Peter Zijlstra wrote:
> On Tue, 2011-11-15 at 23:28 -0800, Paul Turner wrote:
>> On 11/15/2011 10:16 AM, Il Han wrote:
>>> The prototype has to agree with the definition.
>>> Add the inline keyword to the prototype also
>>>
>>
>> Hmm... this would then cause the prototypes to disagree in the
>> !CONFIG_CFS_BANDWIDTH case.
>
> I'm very sure I've compiled a lot of kernels yesterday with various
> permutations including FAIR_GROUP&& !CFS_BANDWIDTH and I'm also very
> sure I haven't actually seen any complaints like this.
>
> It this some new fangled GCC 'feature'? I'm currently still on 4.5 which
> admittedly is somewhat stale.
gcc (even 4.6) won't give warnings either way about the inline attribute on a
forward declaration not matching in either direction. I would imagine this was
found by code-inspection.
I was only pointing out with this we have:
#if CONFIG_CFS_BANDWIDTH
static __always_inline xxx() { stuff; } [1]
#else
static xxx() {} [2]
#endif
And that by only changing the pre-declaration to match [1] it now similarly
(silently) would not match [2] in the !CONFIG case.
- Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-11-16 18:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-15 18:16 [PATCH] sched: add the inline keyword to the prototype Il Han
2011-11-16 7:28 ` Paul Turner
2011-11-16 9:00 ` Peter Zijlstra
2011-11-16 18:40 ` Paul Turner
-- strict thread matches above, loose matches on Subject: below --
2011-11-16 12:45 Il Han
2011-11-16 13:06 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).