Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita73f863

Browse files
jlelliIngo Molnar
authored and
Ingo Molnar
committed
sched/features: Fix !CONFIG_JUMP_LABEL case
Commit:765cc3a ("sched/core: Optimize sched_feat() for !CONFIG_SCHED_DEBUG builds")made sched features static for !CONFIG_SCHED_DEBUG configurations, butoverlooked the CONFIG_SCHED_DEBUG=y and !CONFIG_JUMP_LABEL cases.For the latter echoing changes to /sys/kernel/debug/sched_features hasthe nasty effect of effectively changing what sched_features reports,but without actually changing the scheduler behaviour (since differenttranslation units get different sysctl_sched_features).Fix CONFIG_SCHED_DEBUG=y and !CONFIG_JUMP_LABEL configurations by properlyrestructuring ifdefs.Fixes:765cc3a ("sched/core: Optimize sched_feat() for !CONFIG_SCHED_DEBUG builds")Co-developed-by: Daniel Bristot de Oliveira <bristot@redhat.com>Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>Signed-off-by: Juri Lelli <juri.lelli@redhat.com>Signed-off-by: Ingo Molnar <mingo@kernel.org>Acked-by: Patrick Bellasi <patrick.bellasi@matbug.net>Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>Link:https://lore.kernel.org/r/20201013053114.160628-1-juri.lelli@redhat.com
1 parenteba9f08 commita73f863

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

‎kernel/sched/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);
4444

4545
DEFINE_PER_CPU_SHARED_ALIGNED(structrq,runqueues);
4646

47-
#if defined(CONFIG_SCHED_DEBUG)&& defined(CONFIG_JUMP_LABEL)
47+
#ifdefCONFIG_SCHED_DEBUG
4848
/*
4949
* Debugging: various feature bits
5050
*

‎kernel/sched/sched.h‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,14 +1629,15 @@ enum {
16291629

16301630
#undef SCHED_FEAT
16311631

1632-
#if defined(CONFIG_SCHED_DEBUG)&& defined(CONFIG_JUMP_LABEL)
1632+
#ifdefCONFIG_SCHED_DEBUG
16331633

16341634
/*
16351635
* To support run-time toggling of sched features, all the translation units
16361636
* (but core.c) reference the sysctl_sched_features defined in core.c.
16371637
*/
16381638
externconst_debug unsignedintsysctl_sched_features;
16391639

1640+
#ifdefCONFIG_JUMP_LABEL
16401641
#defineSCHED_FEAT(name,enabled)\
16411642
static __always_inline bool static_branch_##name(struct static_key *key) \
16421643
{\
@@ -1649,7 +1650,13 @@ static __always_inline bool static_branch_##name(struct static_key *key) \
16491650
externstructstatic_keysched_feat_keys[__SCHED_FEAT_NR];
16501651
#definesched_feat(x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x]))
16511652

1652-
#else/* !(SCHED_DEBUG && CONFIG_JUMP_LABEL) */
1653+
#else/* !CONFIG_JUMP_LABEL */
1654+
1655+
#definesched_feat(x) (sysctl_sched_features & (1UL << __SCHED_FEAT_##x))
1656+
1657+
#endif/* CONFIG_JUMP_LABEL */
1658+
1659+
#else/* !SCHED_DEBUG */
16531660

16541661
/*
16551662
* Each translation unit has its own copy of sysctl_sched_features to allow
@@ -1665,7 +1672,7 @@ static const_debug __maybe_unused unsigned int sysctl_sched_features =
16651672

16661673
#definesched_feat(x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x))
16671674

1668-
#endif/* SCHED_DEBUG&& CONFIG_JUMP_LABEL*/
1675+
#endif/* SCHED_DEBUG */
16691676

16701677
externstructstatic_key_falsesched_numa_balancing;
16711678
externstructstatic_key_falsesched_schedstats;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp