LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio()
@ 2018-10-30 14:45 Muchun Song
  2018-10-30 15:13 ` kbuild test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Muchun Song @ 2018-10-30 14:45 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel

When CONFIG_RT_GROUP_SCHED is not configured, group_rt_rq() will
return NULL. With this patch applied, we also can get the same result.
Because the compiler will help us optimize the code.

So, we can remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio().

Signed-off-by: Muchun Song <smuchun@gmail.com>
---
 kernel/sched/rt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index a21ea6021929..47b4800761db 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -894,12 +894,10 @@ static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun)
 
 static inline int rt_se_prio(struct sched_rt_entity *rt_se)
 {
-#ifdef CONFIG_RT_GROUP_SCHED
 	struct rt_rq *rt_rq = group_rt_rq(rt_se);
 
 	if (rt_rq)
 		return rt_rq->highest_prio.curr;
-#endif
 
 	return rt_task_of(rt_se)->prio;
 }
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio()
  2018-10-30 14:45 [PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio() Muchun Song
@ 2018-10-30 15:13 ` kbuild test robot
  2018-10-30 15:42   ` 宋牧春
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2018-10-30 15:13 UTC (permalink / raw)
  To: Muchun Song; +Cc: kbuild-all, mingo, peterz, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2120 bytes --]

Hi Muchun,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on v4.19 next-20181030]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Muchun-Song/sched-rt-Remove-unnecessary-CONFIG_RT_GROUP_SCHED-in-rt_se_prio/20181030-225925
config: i386-randconfig-x002-201843 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   kernel/sched/rt.c: In function 'rt_se_prio':
>> kernel/sched/rt.c:900:15: error: 'struct rt_rq' has no member named 'highest_prio'
      return rt_rq->highest_prio.curr;
                  ^~

vim +900 kernel/sched/rt.c

ac086bc2 kernel/sched_rt.c Peter Zijlstra  2008-04-19  894  
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  895  static inline int rt_se_prio(struct sched_rt_entity *rt_se)
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  896  {
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  897  	struct rt_rq *rt_rq = group_rt_rq(rt_se);
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  898  
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  899  	if (rt_rq)
e864c499 kernel/sched_rt.c Gregory Haskins 2008-12-29 @900  		return rt_rq->highest_prio.curr;
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  901  
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  902  	return rt_task_of(rt_se)->prio;
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  903  }
6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  904  

:::::: The code at line 900 was first introduced by commit
:::::: e864c499d9e57805ae1f9e7ea404dd223759cd53 sched: track the next-highest priority on each runqueue

:::::: TO: Gregory Haskins <ghaskins@novell.com>
:::::: CC: Gregory Haskins <ghaskins@novell.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31105 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio()
  2018-10-30 15:13 ` kbuild test robot
@ 2018-10-30 15:42   ` 宋牧春
  0 siblings, 0 replies; 3+ messages in thread
From: 宋牧春 @ 2018-10-30 15:42 UTC (permalink / raw)
  To: lkp; +Cc: kbuild-all, Ingo Molnar, Peter Zijlstra, linux-kernel

Hi,

I am sorry that I did not consider CONFIG_SMP is also not configured.
In this case, 'struct rt_rq' has no member named 'highest_prio'. So, I
I understand why the code here needs CONFIG_RT_GROUP_SCHED.
When CONFIG_SMP or CONFIG_RT_GROUP_SCHED is configured,
'struct rt_rq' will have member named 'highest_prio'.

So, this patch does't make sense.


kbuild test robot <lkp@intel.com> 于2018年10月30日周二 下午11:14写道:
>
> Hi Muchun,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on tip/sched/core]
> [also build test ERROR on v4.19 next-20181030]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Muchun-Song/sched-rt-Remove-unnecessary-CONFIG_RT_GROUP_SCHED-in-rt_se_prio/20181030-225925
> config: i386-randconfig-x002-201843 (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
>    kernel/sched/rt.c: In function 'rt_se_prio':
> >> kernel/sched/rt.c:900:15: error: 'struct rt_rq' has no member named 'highest_prio'
>       return rt_rq->highest_prio.curr;
>                   ^~
>
> vim +900 kernel/sched/rt.c
>
> ac086bc2 kernel/sched_rt.c Peter Zijlstra  2008-04-19  894
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  895  static inline int rt_se_prio(struct sched_rt_entity *rt_se)
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  896  {
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  897      struct rt_rq *rt_rq = group_rt_rq(rt_se);
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  898
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  899      if (rt_rq)
> e864c499 kernel/sched_rt.c Gregory Haskins 2008-12-29 @900              return rt_rq->highest_prio.curr;
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  901
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  902      return rt_task_of(rt_se)->prio;
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  903  }
> 6f505b16 kernel/sched_rt.c Peter Zijlstra  2008-01-25  904
>
> :::::: The code at line 900 was first introduced by commit
> :::::: e864c499d9e57805ae1f9e7ea404dd223759cd53 sched: track the next-highest priority on each runqueue
>
> :::::: TO: Gregory Haskins <ghaskins@novell.com>
> :::::: CC: Gregory Haskins <ghaskins@novell.com>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-30 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 14:45 [PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio() Muchun Song
2018-10-30 15:13 ` kbuild test robot
2018-10-30 15:42   ` 宋牧春

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).