sched/urgent for 5.8-rc3
Hi Linus,
please pull the sched/urgent pile. I had to rebase it last-minute ontop of -rc2 because it was based on a random merge commit after -rc2 and I know you don't like pull requests based on random commits if there's not a real reason for that.
Peter and I did try to look for a real reason but the commits which were between the -rc2 tag and the merge commit were three regulator/regmap/spi pulls which don't have anything to do with sched. Which led us to conclude that those patches were erroneously rebased on the state of your master branch at the time.
A quick build and boot smoke tests showed too that those changes are unrelated.
( Btw, the rebase was done to fix up the SOB chain in a commit and trim
a commit message. )
So yeah, I know, we should not rebase stuff but considering the above, I guess that's ok in this case as the history cleanliness is more important here. I could be missing an important aspect, though...
Thx.
---
The following changes since commit 48778464bb7d346b47157d21ffde2af6b2d39110:
Linux 5.8-rc2 (2020-06-21 15:45:29 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tags/sched_urgent_for_5.8_rc3
for you to fetch changes up to e21cf43406a190adfcc4bfe592768066fb3aaa9b:
sched/cfs: change initial value of runnable_avg (2020-06-28 17:01:20 +0200)
----------------------------------------------------------------
Peter Zijlstra says:
The most anticipated fix in this pull request is probably the horrible build fix for the RANDSTRUCT fail that didn't make -rc2. Also included is the cleanup that removes those BUILD_BUG_ON()s and replaces it with ugly unions.
Also included is the try_to_wake_up() race fix that was first triggered by Paul's RCU-torture runs, but was independently hit by Dave Chinner's fstest runs as well.
----------------------------------------------------------------
Juri Lelli (2):
sched/deadline: Initialize ->dl_boosted sched/core: Fix PI boosting between RT and DEADLINE tasks
Peter Zijlstra (4):
sched/core: Fix CONFIG_GCC_PLUGIN_RANDSTRUCT build fail sched/core: Fix ttwu() race
sched/core: s/WF_ON_RQ/WQ_ON_CPU/
smp, irq_work: Continue smp_call_function*() and irq_work*() integration
Scott Wood (1):
sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption
Vincent Guittot (1):
sched/cfs: change initial value of runnable_avg
include/linux/irq_work.h | 26 ++++++------------- include/linux/sched.h | 3 +-- include/linux/smp.h | 23 ++++++----------- include/linux/smp_types.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++ kernel/sched/core.c | 44 ++++++++++++++++++++++++------- kernel/sched/deadline.c | 1 + kernel/sched/fair.c | 2 +- kernel/sched/sched.h | 2 +- kernel/smp.c | 18 ------------- 9 files changed, 120 insertions(+), 65 deletions(-) create mode 100644 include/linux/smp_types.h
Signature · 4 lines
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG NürnbergQuoted 6 lines · Borislav Petkov
Hi Linus,
please pull the sched/urgent pile. I had to rebase it last-minute ontop of -rc2 because it was based on a random merge commit after -rc2 and I know you don't like pull requests based on random commits if there's not a real reason for that.
I based sched/urgent on a tested-working merge commit, not on a random interim commit - in this sense your rebase of 68f7b5cc835d was somewhat unnecessary.
I believe avoiding random merge commits is mostly relevant in the merge window phase, when reliability of interim merge stages is arguably low and same-day rebases were a disease a couple of years ago.
But after -rc1 using 'daily' upstream merge points is not nearly as questionable, especially if it's backed by testing like I did. Arguably post-rc1 merge points all increase reliability, and since that was the base I tested, it's what I used for the sched/urgent tree.
So in case Linus prefers the 'old' branch from a couple of days ago instead of the freshly rebased one from today, you can find it at:
Linus,
Please pull the latest sched/urgent git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-2020-06-28
# HEAD: 68f7b5cc835de7d5b6c7696533c126018171e793 sched/cfs: change initial value of runnable_avg
"The most anticipated fix in this pull request is probably the horrible build
fix for the RANDSTRUCT fail that didn't make -rc2. Also included is the cleanup that removes those BUILD_BUG_ON()s and replaces it with ugly unions.
Also included is the try_to_wake_up() race fix that was first triggered by Paul's RCU-torture runs, but was independently hit by Dave Chinner's fstest runs as well."
Thanks,
Ingo
------------------>
Juri Lelli (2):
sched/deadline: Initialize ->dl_boosted sched/core: Fix PI boosting between RT and DEADLINE tasks
Peter Zijlstra (4):
sched/core: Fix CONFIG_GCC_PLUGIN_RANDSTRUCT build fail sched/core: Fix ttwu() race
sched/core: s/WF_ON_RQ/WQ_ON_CPU/
smp, irq_work: Continue smp_call_function*() and irq_work*() integration
Scott Wood (1):
sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption
Vincent Guittot (1):
sched/cfs: change initial value of runnable_avg
include/linux/irq_work.h | 26 ++++++------------- include/linux/sched.h | 3 +-- include/linux/smp.h | 23 ++++++----------- include/linux/smp_types.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++ kernel/sched/core.c | 44 ++++++++++++++++++++++++------- kernel/sched/deadline.c | 1 + kernel/sched/fair.c | 2 +- kernel/sched/sched.h | 2 +- kernel/smp.c | 18 ------------- 9 files changed, 120 insertions(+), 65 deletions(-) create mode 100644 include/linux/smp_types.h
include/linux/irq_work.h +8 -18
@@ -2,7 +2,7 @@#ifndef _LINUX_IRQ_WORK_H#define _LINUX_IRQ_WORK_H -#include <linux/llist.h> +#include <linux/smp_types.h> /* * An entry can be in one of four states:
@@ -13,24 +13,14 @@* busy NULL, 2 -> {free, claimed} : callback in progress, can be claimed */ -/* flags share CSD_FLAG_ space */ - -#define IRQ_WORK_PENDING BIT(0) -#define IRQ_WORK_BUSY BIT(1) - -/* Doesn't want IPI, wait for tick: */ -#define IRQ_WORK_LAZY BIT(2) -/* Run hard IRQ context, even on RT */ -#define IRQ_WORK_HARD_IRQ BIT(3) - -#define IRQ_WORK_CLAIMED (IRQ_WORK_PENDING | IRQ_WORK_BUSY) - -/* -* structure shares layout with single_call_data_t. -*/ struct irq_work { -struct llist_node llnode; -atomic_t flags; +union { +struct __call_single_node node; +struct { +struct llist_node llnode; +atomic_t flags; + }; + };void (*func)(struct irq_work *); };
include/linux/sched.h +1 -2
@@ -654,9 +654,8 @@ struct task_struct {unsigned int ptrace;#ifdef CONFIG_SMP -struct llist_node wake_entry; -unsigned int wake_entry_type;int on_cpu; +struct __call_single_node wake_entry;#ifdef CONFIG_THREAD_INFO_IN_TASK /* Current CPU: */ unsigned int cpu;
include/linux/smp.h +8 -15
@@ -12,29 +12,22 @@#include <linux/list.h> #include <linux/cpumask.h> #include <linux/init.h> -#include <linux/llist.h> +#include <linux/smp_types.h> typedef void (*smp_call_func_t )(void *info);typedef bool (*smp_cond_func_t )(int cpu,void *info); -enum { -CSD_FLAG_LOCK =0x01 , - -/* IRQ_WORK_flags */ - -CSD_TYPE_ASYNC =0x00 , -CSD_TYPE_SYNC =0x10 , -CSD_TYPE_IRQ_WORK =0x20 , -CSD_TYPE_TTWU =0x30 , -CSD_FLAG_TYPE_MASK =0xF0 , -}; -/* * structure shares (partial) layout with struct irq_work */ struct __call_single_data { -struct llist_node llist; -unsigned int flags; +union { +struct __call_single_node node; +struct { +struct llist_node llist; +unsigned int flags; + }; + };smp_call_func_t func;void *info; };
include/linux/smp_types.h new file +66 -0
66 lines not on this page · raw message
kernel/sched/core.c +34 -10
118 lines not on this page · raw message
kernel/sched/deadline.c +1 -0
@@ -2692,6 +2692,7 @@ void __dl_clear_params(struct task_struct *p) dl_se->dl_bw =0 ; dl_se->dl_density =0 ; + dl_se->dl_boosted =0 ; dl_se->dl_throttled =0 ; dl_se->dl_yielded =0 ; dl_se->dl_non_contending =0 ;
kernel/sched/fair.c +1 -1
@@ -806,7 +806,7 @@ void post_init_entity_util_avg(struct task_struct *p) } } - sa->runnable_avg = cpu_scale; + sa->runnable_avg = sa->util_avg;if (p->sched_class != &fair_sched_class) {/*
kernel/sched/sched.h +1 -1
@@ -1682,7 +1682,7 @@ static inline int task_on_rq_migrating(struct task_struct *p)#define WF_SYNC 0x01/* Waker goes to sleep after wakeup */ #define WF_FORK 0x02/* Child wakeup after fork */ #define WF_MIGRATED 0x04/* Internal use, task got migrated */ -#define WF_ON_RQ 0x08/* Wakee is on_rq */ +#define WF_ON_CPU 0x08/* Wakee is on_cpu */ /* * To aid in avoiding the subversion of "niceness" due to uneven distribution
kernel/smp.c +0 -18
@@ -669,24 +669,6 @@ void __init smp_init(void) {int num_nodes, num_cpus; -/* -* Ensure struct irq_work layout matches so that -* flush_smp_call_function_queue() can do horrible things. -*/ -BUILD_BUG_ON (offsetof(struct irq_work , llnode) != - offsetof(struct __call_single_data , llist)); -BUILD_BUG_ON (offsetof(struct irq_work , func) != - offsetof(struct __call_single_data , func)); -BUILD_BUG_ON (offsetof(struct irq_work , flags) != - offsetof(struct __call_single_data , flags)); - -/* -* Assert the CSD_TYPE_TTWU layout is similar enough -* for task_struct to be on the @call_single_queue. -*/ -BUILD_BUG_ON (offsetof(struct task_struct , wake_entry_type) - offsetof(struct task_struct , wake_entry) != - offsetof(struct __call_single_data , flags) - offsetof(struct __call_single_data , llist)); -idle_threads_init ();cpuhp_threads_init ();
Quoted 9 lines · Ingo Molnar
I based sched/urgent on a tested-working merge commit, not on a random interim commit - in this sense your rebase of
68f7b5cc835dwas somewhat unnecessary.I believe avoiding random merge commits is mostly relevant in the merge window phase, when reliability of interim merge stages is arguably low and same-day rebases were a disease a couple of years ago.
Yes. And in general I'd prefer to not see rebases.
I took the rebased pull from Borislav already, though, so it's there now.
Linus
The pull request you sent on Sun, 28 Jun 2020 17:23:42 +0200:
The pull request you sent on Sun, 28 Jun 2020 17:23:42 +0200:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gittags/sched_urgent_for_5.8_rc3
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/91a9a90d040e8b9ff63d48ea71468e0f4db764ff
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker