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

Commita9903f0

Browse files
Matthias KaehlckeIngo Molnar
Matthias Kaehlcke
authored and
Ingo Molnar
committed
sched/sysctl: Fix attributes of some extern declarations
The definition of sysctl_sched_migration_cost, sysctl_sched_nr_migrateand sysctl_sched_time_avg includes the attribute const_debug. Thisattribute is not part of the extern declaration of these variables ininclude/linux/sched/sysctl.h, while it is in kernel/sched/sched.h,and as a result Clang generates warnings like this: kernel/sched/sched.h:1618:33: warning: section attribute is specified on redeclared variable [-Wsection] extern const_debug unsigned int sysctl_sched_time_avg; ^ ./include/linux/sched/sysctl.h:42:21: note: previous declaration is here extern unsigned int sysctl_sched_time_avg;The header only declares the variables when CONFIG_SCHED_DEBUG is defined,therefore it is not necessary to duplicate the definition of const_debug.Instead we can use the attribute __read_mostly, which is the expansion ofconst_debug when CONFIG_SCHED_DEBUG=y is set.Signed-off-by: Matthias Kaehlcke <mka@chromium.org>Reviewed-by: Nick Desaulniers <nick.desaulniers@gmail.com>Cc: Douglas Anderson <dianders@chromium.org>Cc: Guenter Roeck <groeck@chromium.org>Cc: Linus Torvalds <torvalds@linux-foundation.org>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Shile Zhang <shile.zhang@nokia.com>Cc: Thomas Gleixner <tglx@linutronix.de>Link:http://lkml.kernel.org/r/20171030180816.170850-1-mka@chromium.orgSigned-off-by: Ingo Molnar <mingo@kernel.org>
1 parentb0d40d2 commita9903f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎include/linux/sched/sysctl.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ extern unsigned int sysctl_numa_balancing_scan_period_max;
3737
externunsignedintsysctl_numa_balancing_scan_size;
3838

3939
#ifdefCONFIG_SCHED_DEBUG
40-
externunsignedintsysctl_sched_migration_cost;
41-
externunsignedintsysctl_sched_nr_migrate;
42-
externunsignedintsysctl_sched_time_avg;
40+
extern__read_mostlyunsignedintsysctl_sched_migration_cost;
41+
extern__read_mostlyunsignedintsysctl_sched_nr_migrate;
42+
extern__read_mostlyunsignedintsysctl_sched_time_avg;
4343

4444
intsched_proc_update_handler(structctl_table*table,intwrite,
4545
void__user*buffer,size_t*length,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp