Re: [PATCH 4/6] kvm: lapic: Add apicv activate/deactivate helper function

2019-05-08 Thread Jan H . Schönherr
On 22/03/2019 12.57, Suthikulpanit, Suravee wrote: > Introduce a helper function for setting lapic parameters when > activate/deactivate apicv. > > Signed-off-by: Suravee Suthikulpanit > --- > arch/x86/kvm/lapic.c | 23 ++- > arch/x86/kvm/lapic.h | 1 + > 2 files changed,

Re: [PATCH 5/6] KVM: x86: Add interface for run-time activate/de-activate APIC virtualization

2019-05-08 Thread Jan H . Schönherr
On 22/03/2019 12.57, Suthikulpanit, Suravee wrote: > When activate / deactivate AVIC during runtime, all vcpus has to be > operating in the same mode. So, introduce new interface to request > all vCPUs to activate/deactivate APICV. If we need to switch APICV on and off on all vCPUs of a VM,

Re: [PATCH 3/6] svm: Add support for APIC_ACCESS_PAGE_PRIVATE_MEMSLOT setup/destroy

2019-05-08 Thread Jan H . Schönherr
On 22/03/2019 12.57, Suthikulpanit, Suravee wrote: > Activate/deactivate AVIC requires setting/unsetting the memory region used > for APIC_ACCESS_PAGE_PRIVATE_MEMSLOT. So, re-factor avic_init_access_page() > to avic_setup_access_page() and add srcu_read_lock/unlock, which are needed > to allow

Re: [PATCH 6/6] svm: Temporary deactivate AVIC during ExtINT handling

2019-05-08 Thread Jan H . Schönherr
Hi Suravee. I wonder, how this interacts with Hyper-V SynIC; see comments below. On 22/03/2019 12.57, Suthikulpanit, Suravee wrote: > AMD AVIC does not support ExtINT. Therefore, AVIC must be temporary > deactivated and fall back to using legacy interrupt injection via > vINTR and interrupt

Re: [PATCH v2] x86/tsc: Allow quick PIT calibration despite interruptions

2019-02-14 Thread Jan H . Schönherr
Am 14.02.19 um 22:46 schrieb Jan H. Schönherr: Some systems experience regular interruptions (60 Hz SMI?), that prevent the quick PIT calibration from succeeding: individual interruptions can be so long, that the PIT MSB is observed to decrement by 2 or 3 instead of 1. The existing code cannot

Re: [PATCH 1/2] x86/tsc: Allow quick PIT calibration despite interruptions

2019-02-14 Thread Jan H . Schönherr
Am 12.02.19 um 12:57 schrieb Thomas Gleixner: On Tue, 29 Jan 2019, Thomas Gleixner wrote: On Tue, 29 Jan 2019, Jan H. Schönherr wrote: Am 29.01.2019 um 11:23 schrieb Jan H. Schönherr: +calibrate: + /* +* Extrapolate the error and fail fast if the error will +* never

[PATCH v2] x86/tsc: Allow quick PIT calibration despite interruptions

2019-02-14 Thread Jan H . Schönherr
the very first reads. Signed-off-by: Jan H. Schönherr --- v2: - Dropped the other hacky patch for the time being. - Fixed the early exit check. - Hopefully fixed all inaccurate math in v1. - Extended comments. arch/x86/kernel/tsc.c | 91 +++ 1 file changed, 57

[PATCH 1/2] x86/tsc: Allow quick PIT calibration despite interruptions

2019-01-29 Thread Jan H . Schönherr
the very first reads. Signed-off-by: Jan H. Schönherr --- arch/x86/kernel/tsc.c | 80 +-- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index e9f777bfed40..a005e0aa215e 100644 --- a/arch/x86/kernel

[PATCH 2/2] cpu/hotplug: Unfreeze sibling CPU first on resume from S3

2019-01-29 Thread Jan H . Schönherr
Fatal1ty X399 Professional Gaming, BIOS P3.30. This unexplained behavior goes away as soon as the sibling CPU of the boot CPU is brought back up. Hence, add a hack to restore the sibling CPU before all others on unfreeze. This keeps the TSC stable. Signed-off-by: Jan H. Schönherr --- kernel/cpu.c

[PATCH 0/2] Fix TSC issues on (some) AMD Ryzen based systems

2019-01-29 Thread Jan H . Schönherr
case) hasn't been resumed yet. (I did some experiments with CPU hotplug before and after suspend, but apart from reproducing the issue and verifying the "fix", I got nowhere.) The patches are against v4.20. Jan H. Schönherr (2): x86/tsc: Allow quick PIT calibration despite interrupt

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-12-04 Thread Jan H . Schönherr
On 23/11/2018 17.51, Frederic Weisbecker wrote: > On Tue, Sep 18, 2018 at 03:22:13PM +0200, Jan H. Schönherr wrote: >> On 09/17/2018 11:48 AM, Peter Zijlstra wrote: >>> Right, so the whole bandwidth thing becomes a pain; the simplest >>> solution is to detect the

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-12-04 Thread Jan H . Schönherr
On 23/11/2018 17.51, Frederic Weisbecker wrote: > On Tue, Sep 18, 2018 at 03:22:13PM +0200, Jan H. Schönherr wrote: >> On 09/17/2018 11:48 AM, Peter Zijlstra wrote: >>> Right, so the whole bandwidth thing becomes a pain; the simplest >>> solution is to detect the

Re: [RFC 00/60] Coscheduling for Linux

2018-10-26 Thread Jan H . Schönherr
On 27/10/2018 01.05, Subhra Mazumdar wrote: > > >> D) What can I *not* do with this? >> - >> >> Besides the missing load-balancing within coscheduled task-groups, this >> implementation has the following properties, which might be considered >> short-comings. >>

Re: [RFC 00/60] Coscheduling for Linux

2018-10-26 Thread Jan H . Schönherr
On 27/10/2018 01.05, Subhra Mazumdar wrote: > > >> D) What can I *not* do with this? >> - >> >> Besides the missing load-balancing within coscheduled task-groups, this >> implementation has the following properties, which might be considered >> short-comings. >>

[RFC 00/60] Coscheduling for Linux

2018-10-26 Thread Jan H . Schönherr
On 19/10/2018 02.26, Subhra Mazumdar wrote: > Hi Jan, Hi. Sorry for the delay. > On 9/7/18 2:39 PM, Jan H. Schönherr wrote: >> The collective context switch from one coscheduled set of tasks to another >> -- while fast -- is not atomic. If a use-case needs the absolute gua

[RFC 00/60] Coscheduling for Linux

2018-10-26 Thread Jan H . Schönherr
On 19/10/2018 02.26, Subhra Mazumdar wrote: > Hi Jan, Hi. Sorry for the delay. > On 9/7/18 2:39 PM, Jan H. Schönherr wrote: >> The collective context switch from one coscheduled set of tasks to another >> -- while fast -- is not atomic. If a use-case needs the absolute gua

Re: [RFC 00/60] Coscheduling for Linux

2018-10-19 Thread Jan H . Schönherr
On 19/10/2018 17.45, Rik van Riel wrote: > On Fri, 2018-10-19 at 17:33 +0200, Frederic Weisbecker wrote: >> On Fri, Oct 19, 2018 at 11:16:49AM -0400, Rik van Riel wrote: >>> On Fri, 2018-10-19 at 13:40 +0200, Jan H. Schönherr wrote: >>>> >>>> Now, it

Re: [RFC 00/60] Coscheduling for Linux

2018-10-19 Thread Jan H . Schönherr
On 19/10/2018 17.45, Rik van Riel wrote: > On Fri, 2018-10-19 at 17:33 +0200, Frederic Weisbecker wrote: >> On Fri, Oct 19, 2018 at 11:16:49AM -0400, Rik van Riel wrote: >>> On Fri, 2018-10-19 at 13:40 +0200, Jan H. Schönherr wrote: >>>> >>>> Now, it

Re: [RFC 00/60] Coscheduling for Linux

2018-10-19 Thread Jan H . Schönherr
On 17/10/2018 04.09, Frederic Weisbecker wrote: > On Fri, Sep 07, 2018 at 11:39:47PM +0200, Jan H. Schönherr wrote: >> C) How does it work? >> [...] >> For each task-group, the user can select at which level it should be >> scheduled. If yo

Re: [RFC 00/60] Coscheduling for Linux

2018-10-19 Thread Jan H . Schönherr
On 17/10/2018 04.09, Frederic Weisbecker wrote: > On Fri, Sep 07, 2018 at 11:39:47PM +0200, Jan H. Schönherr wrote: >> C) How does it work? >> [...] >> For each task-group, the user can select at which level it should be >> scheduled. If yo

Re: [RFC 61/60] cosched: Accumulated fixes and improvements

2018-10-01 Thread Jan H. Schönherr
On 09/26/2018 11:05 PM, Nishanth Aravamudan wrote: > On 26.09.2018 [10:25:19 -0700], Nishanth Aravamudan wrote: >> >> I found another issue today, while attempting to test (with 61/60 >> applied) separate coscheduling cgroups for vcpus and emulator threads >> [the default configuration with

Re: [RFC 61/60] cosched: Accumulated fixes and improvements

2018-10-01 Thread Jan H. Schönherr
On 09/26/2018 11:05 PM, Nishanth Aravamudan wrote: > On 26.09.2018 [10:25:19 -0700], Nishanth Aravamudan wrote: >> >> I found another issue today, while attempting to test (with 61/60 >> applied) separate coscheduling cgroups for vcpus and emulator threads >> [the default configuration with

Re: [RFC 00/60] Coscheduling for Linux

2018-09-26 Thread Jan H. Schönherr
On 09/17/2018 02:25 PM, Peter Zijlstra wrote: > On Fri, Sep 14, 2018 at 06:25:44PM +0200, Jan H. Schönherr wrote: > >> Assuming, there is a cgroup-less solution that can prevent simultaneous >> execution of tasks on a core, when they're not supposed to. How would you >> t

Re: [RFC 00/60] Coscheduling for Linux

2018-09-26 Thread Jan H. Schönherr
On 09/17/2018 02:25 PM, Peter Zijlstra wrote: > On Fri, Sep 14, 2018 at 06:25:44PM +0200, Jan H. Schönherr wrote: > >> Assuming, there is a cgroup-less solution that can prevent simultaneous >> execution of tasks on a core, when they're not supposed to. How would you >> t

Re: [RFC 00/60] Coscheduling for Linux

2018-09-26 Thread Jan H. Schönherr
On 09/17/2018 03:37 PM, Peter Zijlstra wrote: > On Fri, Sep 14, 2018 at 06:25:44PM +0200, Jan H. Schönherr wrote: >> With gang scheduling as defined by Feitelson and Rudolph [6], you'd have to >> explicitly schedule idle time. With coscheduling as defined by Ousterhout >&

Re: [RFC 00/60] Coscheduling for Linux

2018-09-26 Thread Jan H. Schönherr
On 09/17/2018 03:37 PM, Peter Zijlstra wrote: > On Fri, Sep 14, 2018 at 06:25:44PM +0200, Jan H. Schönherr wrote: >> With gang scheduling as defined by Feitelson and Rudolph [6], you'd have to >> explicitly schedule idle time. With coscheduling as defined by Ousterhout >&

Re: [RFC 00/60] Coscheduling for Linux

2018-09-24 Thread Jan H. Schönherr
On 09/19/2018 11:53 PM, Subhra Mazumdar wrote: > Can we have a more generic interface, like specifying a set of task ids > to be co-scheduled with a particular level rather than tying this with > cgroups? KVMs may not always run with cgroups and there might be other > use cases where we might

Re: [RFC 00/60] Coscheduling for Linux

2018-09-24 Thread Jan H. Schönherr
On 09/19/2018 11:53 PM, Subhra Mazumdar wrote: > Can we have a more generic interface, like specifying a set of task ids > to be co-scheduled with a particular level rather than tying this with > cgroups? KVMs may not always run with cgroups and there might be other > use cases where we might

Re: [RFC 00/60] Coscheduling for Linux

2018-09-24 Thread Jan H. Schönherr
On 09/18/2018 04:40 PM, Rik van Riel wrote: > On Fri, 2018-09-14 at 18:25 +0200, Jan H. Schönherr wrote: >> On 09/14/2018 01:12 PM, Peter Zijlstra wrote: >>> On Fri, Sep 07, 2018 at 11:39:47PM +0200, Jan H. Schönherr wrote: >>>> >>>> B) Why would I wa

Re: [RFC 00/60] Coscheduling for Linux

2018-09-24 Thread Jan H. Schönherr
On 09/18/2018 04:40 PM, Rik van Riel wrote: > On Fri, 2018-09-14 at 18:25 +0200, Jan H. Schönherr wrote: >> On 09/14/2018 01:12 PM, Peter Zijlstra wrote: >>> On Fri, Sep 07, 2018 at 11:39:47PM +0200, Jan H. Schönherr wrote: >>>> >>>> B) Why would I wa

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-19 Thread Jan H. Schönherr
On 09/18/2018 04:35 PM, Rik van Riel wrote: > On Tue, 2018-09-18 at 15:22 +0200, Jan H. Schönherr wrote: [...] > Task priorities in a flat runqueue are relatively straightforward, with > vruntime scaling just like done for nice levels, but I have to admit > that throttled gr

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-19 Thread Jan H. Schönherr
On 09/18/2018 04:35 PM, Rik van Riel wrote: > On Tue, 2018-09-18 at 15:22 +0200, Jan H. Schönherr wrote: [...] > Task priorities in a flat runqueue are relatively straightforward, with > vruntime scaling just like done for nice levels, but I have to admit > that throttled gr

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-18 Thread Jan H. Schönherr
On 09/18/2018 03:38 PM, Peter Zijlstra wrote: > On Tue, Sep 18, 2018 at 03:22:13PM +0200, Jan H. Schönherr wrote: >> AFAIK, changing the affinity of a cpuset overwrites the individual >> affinities of tasks >> within them. Thus, it shouldn't be an issue. > > No, it

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-18 Thread Jan H. Schönherr
On 09/18/2018 03:38 PM, Peter Zijlstra wrote: > On Tue, Sep 18, 2018 at 03:22:13PM +0200, Jan H. Schönherr wrote: >> AFAIK, changing the affinity of a cpuset overwrites the individual >> affinities of tasks >> within them. Thus, it shouldn't be an issue. > > No, it

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-18 Thread Jan H. Schönherr
On 09/17/2018 11:48 AM, Peter Zijlstra wrote: > On Sat, Sep 15, 2018 at 10:48:20AM +0200, Jan H. Schönherr wrote: >> On 09/14/2018 06:25 PM, Jan H. Schönherr wrote: > >>> b) ability to move CFS RQs between CPUs: someone changed the affinity of >>>a cpuset? No pro

Re: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-18 Thread Jan H. Schönherr
On 09/17/2018 11:48 AM, Peter Zijlstra wrote: > On Sat, Sep 15, 2018 at 10:48:20AM +0200, Jan H. Schönherr wrote: >> On 09/14/2018 06:25 PM, Jan H. Schönherr wrote: > >>> b) ability to move CFS RQs between CPUs: someone changed the affinity of >>>a cpuset? No pro

Re: [RFC 00/60] Coscheduling for Linux

2018-09-18 Thread Jan H. Schönherr
On 09/18/2018 02:33 AM, Subhra Mazumdar wrote: > On 09/07/2018 02:39 PM, Jan H. Schönherr wrote: >> A) Quickstart guide for the impatient. >> -- >> >> Here is a quickstart guide to set up coscheduling at core-level for >> select

Re: [RFC 00/60] Coscheduling for Linux

2018-09-18 Thread Jan H. Schönherr
On 09/18/2018 02:33 AM, Subhra Mazumdar wrote: > On 09/07/2018 02:39 PM, Jan H. Schönherr wrote: >> A) Quickstart guide for the impatient. >> -- >> >> Here is a quickstart guide to set up coscheduling at core-level for >> select

Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-15 Thread Jan H. Schönherr
On 09/14/2018 06:25 PM, Jan H. Schönherr wrote: > On 09/14/2018 01:12 PM, Peter Zijlstra wrote: >> >> There are known scalability problems with the existing cgroup muck; you >> just made things a ton worse. The existing cgroup overhead is >> significant, you also

Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux)

2018-09-15 Thread Jan H. Schönherr
On 09/14/2018 06:25 PM, Jan H. Schönherr wrote: > On 09/14/2018 01:12 PM, Peter Zijlstra wrote: >> >> There are known scalability problems with the existing cgroup muck; you >> just made things a ton worse. The existing cgroup overhead is >> significant, you also

Re: [RFC 00/60] Coscheduling for Linux

2018-09-14 Thread Jan H. Schönherr
On 09/14/2018 01:12 PM, Peter Zijlstra wrote: > On Fri, Sep 07, 2018 at 11:39:47PM +0200, Jan H. Schönherr wrote: >> This patch series extends CFS with support for coscheduling. The >> implementation is versatile enough to cover many different coscheduling >> use-cases, w

Re: [RFC 00/60] Coscheduling for Linux

2018-09-14 Thread Jan H. Schönherr
On 09/14/2018 01:12 PM, Peter Zijlstra wrote: > On Fri, Sep 07, 2018 at 11:39:47PM +0200, Jan H. Schönherr wrote: >> This patch series extends CFS with support for coscheduling. The >> implementation is versatile enough to cover many different coscheduling >> use-cases, w

[RFC 61/60] cosched: Accumulated fixes and improvements

2018-09-13 Thread Jan H . Schönherr
py. Partly-reported-by: Nishanth Aravamudan Signed-off-by: Jan H. Schönherr --- kernel/sched/cosched.c | 2 ++ kernel/sched/fair.c| 35 ++- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/kernel/sched/cosched.c b/kernel/sched/cosched.c index a1f0d3

[RFC 61/60] cosched: Accumulated fixes and improvements

2018-09-13 Thread Jan H . Schönherr
py. Partly-reported-by: Nishanth Aravamudan Signed-off-by: Jan H. Schönherr --- kernel/sched/cosched.c | 2 ++ kernel/sched/fair.c| 35 ++- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/kernel/sched/cosched.c b/kernel/sched/cosched.c index a1f0d3

Re: [RFC 00/60] Coscheduling for Linux

2018-09-13 Thread Jan H. Schönherr
On 09/13/2018 01:15 AM, Nishanth Aravamudan wrote: > [...] if I just try to set machine's > cpu.scheduled to 1, with no other changes (not even changing any child > cgroup's cpu.scheduled yet), I get the following trace: > > [16052.164259] [ cut here ] > [16052.168973]

Re: [RFC 00/60] Coscheduling for Linux

2018-09-13 Thread Jan H. Schönherr
On 09/13/2018 01:15 AM, Nishanth Aravamudan wrote: > [...] if I just try to set machine's > cpu.scheduled to 1, with no other changes (not even changing any child > cgroup's cpu.scheduled yet), I get the following trace: > > [16052.164259] [ cut here ] > [16052.168973]

[RFC 00/60] Coscheduling for Linux

2018-09-12 Thread Jan H. Schönherr
On 09/12/2018 09:34 PM, Jan H. Schönherr wrote: > That said, I see a hang, too. It seems to happen, when there is a > cpu.scheduled!=0 group that is not a direct child of the root task group. > You seem to have "/sys/fs/cgroup/cpu/machine" as an intermediate group. > (T

[RFC 00/60] Coscheduling for Linux

2018-09-12 Thread Jan H. Schönherr
On 09/12/2018 09:34 PM, Jan H. Schönherr wrote: > That said, I see a hang, too. It seems to happen, when there is a > cpu.scheduled!=0 group that is not a direct child of the root task group. > You seem to have "/sys/fs/cgroup/cpu/machine" as an intermediate group. > (T

Re: [RFC 00/60] Coscheduling for Linux

2018-09-12 Thread Jan H. Schönherr
On 09/12/2018 02:24 AM, Nishanth Aravamudan wrote: > [ I am not subscribed to LKML, please keep me CC'd on replies ] > > I tried a simple test with several VMs (in my initial test, I have 48 > idle 1-cpu 512-mb VMs and 2 idle 2-cpu, 2-gb VMs) using libvirt, none > pinned to any CPUs. When I tried

Re: [RFC 00/60] Coscheduling for Linux

2018-09-12 Thread Jan H. Schönherr
On 09/12/2018 02:24 AM, Nishanth Aravamudan wrote: > [ I am not subscribed to LKML, please keep me CC'd on replies ] > > I tried a simple test with several VMs (in my initial test, I have 48 > idle 1-cpu 512-mb VMs and 2 idle 2-cpu, 2-gb VMs) using libvirt, none > pinned to any CPUs. When I tried

[RFC 00/60] Coscheduling for Linux

2018-09-07 Thread Jan H . Schönherr
ghts are: 23: Data structures used for coscheduling. 24-26: Creation of root-task-group runqueue hierarchy. 39-40: Runqueue hierarchies for normal task groups. 41-42: Locking strategies under coscheduling. 47-49: Adjust core CFS code. 52: Adjust core CFS code. 54-56: A

[RFC 00/60] Coscheduling for Linux

2018-09-07 Thread Jan H . Schönherr
ghts are: 23: Data structures used for coscheduling. 24-26: Creation of root-task-group runqueue hierarchy. 39-40: Runqueue hierarchies for normal task groups. 41-42: Locking strategies under coscheduling. 47-49: Adjust core CFS code. 52: Adjust core CFS code. 54-56: A

[RFC 01/60] sched: Store task_group->se[] pointers as part of cfs_rq

2018-09-07 Thread Jan H . Schönherr
the other direction. Adjust all users, simplifying many of them. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c | 7 ++- kernel/sched/debug.c | 2 +- kernel/sched/fair.c | 36 kernel/sched/sched.h | 5 ++--- 4 files changed, 21 insertions(+), 2

[RFC 01/60] sched: Store task_group->se[] pointers as part of cfs_rq

2018-09-07 Thread Jan H . Schönherr
the other direction. Adjust all users, simplifying many of them. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c | 7 ++- kernel/sched/debug.c | 2 +- kernel/sched/fair.c | 36 kernel/sched/sched.h | 5 ++--- 4 files changed, 21 insertions(+), 2

[RFC 06/60] sched: Add a lock-free variant of resched_cpu()

2018-09-07 Thread Jan H . Schönherr
-off-by: Jan H. Schönherr --- kernel/sched/core.c | 21 +++-- kernel/sched/sched.h | 6 ++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index fd1b0abd8474..c38a54f57e90 100644 --- a/kernel/sched/core.c +++ b/kernel

[RFC 06/60] sched: Add a lock-free variant of resched_cpu()

2018-09-07 Thread Jan H . Schönherr
-off-by: Jan H. Schönherr --- kernel/sched/core.c | 21 +++-- kernel/sched/sched.h | 6 ++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index fd1b0abd8474..c38a54f57e90 100644 --- a/kernel/sched/core.c +++ b/kernel

[RFC 14/60] sched: Refactor sync_throttle() to accept a CFS runqueue as argument

2018-09-07 Thread Jan H . Schönherr
Prepare for future changes and refactor sync_throttle() to work with a different set of arguments. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index

[RFC 14/60] sched: Refactor sync_throttle() to accept a CFS runqueue as argument

2018-09-07 Thread Jan H . Schönherr
Prepare for future changes and refactor sync_throttle() to work with a different set of arguments. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index

[RFC 15/60] sched: Introduce parent_cfs_rq() and use it

2018-09-07 Thread Jan H . Schönherr
Factor out the logic to retrieve the parent CFS runqueue of another CFS runqueue into its own function and replace open-coded variants. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/kernel/sched

[RFC 15/60] sched: Introduce parent_cfs_rq() and use it

2018-09-07 Thread Jan H . Schönherr
Factor out the logic to retrieve the parent CFS runqueue of another CFS runqueue into its own function and replace open-coded variants. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/kernel/sched

[RFC 26/60] cosched: Construct runqueue hierarchy

2018-09-07 Thread Jan H . Schönherr
With scheduling domains sufficiently prepared, we can now initialize the full hierarchy of runqueues and link it with the already existing bottom level, which we set up earlier. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c| 1 + kernel/sched/cosched.c | 76

[RFC 22/60] cosched: Add config option for coscheduling support

2018-09-07 Thread Jan H . Schönherr
Scheduled task groups will bring coscheduling to Linux. The actual functionality will be added successively. Signed-off-by: Jan H. Schönherr --- init/Kconfig | 11 +++ kernel/sched/Makefile | 1 + kernel/sched/cosched.c | 9 + 3 files changed, 21 insertions

[RFC 26/60] cosched: Construct runqueue hierarchy

2018-09-07 Thread Jan H . Schönherr
With scheduling domains sufficiently prepared, we can now initialize the full hierarchy of runqueues and link it with the already existing bottom level, which we set up earlier. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c| 1 + kernel/sched/cosched.c | 76

[RFC 22/60] cosched: Add config option for coscheduling support

2018-09-07 Thread Jan H . Schönherr
Scheduled task groups will bring coscheduling to Linux. The actual functionality will be added successively. Signed-off-by: Jan H. Schönherr --- init/Kconfig | 11 +++ kernel/sched/Makefile | 1 + kernel/sched/cosched.c | 9 + 3 files changed, 21 insertions

[RFC 30/60] cosched: Disallow share modification on task groups for now

2018-09-07 Thread Jan H . Schönherr
The code path is not yet adjusted for coscheduling. Disable it for now. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 30e5ff30f442..8504790944bf 100644 --- a/kernel/sched

[RFC 30/60] cosched: Disallow share modification on task groups for now

2018-09-07 Thread Jan H . Schönherr
The code path is not yet adjusted for coscheduling. Disable it for now. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 30e5ff30f442..8504790944bf 100644 --- a/kernel/sched

[RFC 37/60] cosched: Use hrq_of() for (indirect calls to) ___update_load_sum()

2018-09-07 Thread Jan H . Schönherr
callers to use hrq_of() instead of rq_of() to derive the cpu argument. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index fde1c4ba4bb4..a2945355f823 100644 --- a/kernel/sched

[RFC 39/60] cosched: Adjust task group management for hierarchical runqueues

2018-09-07 Thread Jan H . Schönherr
Provide variants of the task group CFS traversal constructs that also reach the hierarchical runqueues. Adjust task group management functions where necessary. The most changes are in alloc_fair_sched_group(), where we now need to be a bit more careful during initialization. Signed-off-by: Jan H

[RFC 34/60] cosched: Add rq_of() variants for different use cases

2018-09-07 Thread Jan H . Schönherr
(), which returns the leader's CPU runqueue. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8cba7b8fb6bd..24d01bf8f796 100644 --- a/kernel/sched/fair.c

[RFC 37/60] cosched: Use hrq_of() for (indirect calls to) ___update_load_sum()

2018-09-07 Thread Jan H . Schönherr
callers to use hrq_of() instead of rq_of() to derive the cpu argument. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index fde1c4ba4bb4..a2945355f823 100644 --- a/kernel/sched

[RFC 39/60] cosched: Adjust task group management for hierarchical runqueues

2018-09-07 Thread Jan H . Schönherr
Provide variants of the task group CFS traversal constructs that also reach the hierarchical runqueues. Adjust task group management functions where necessary. The most changes are in alloc_fair_sched_group(), where we now need to be a bit more careful during initialization. Signed-off-by: Jan H

[RFC 34/60] cosched: Add rq_of() variants for different use cases

2018-09-07 Thread Jan H . Schönherr
(), which returns the leader's CPU runqueue. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8cba7b8fb6bd..24d01bf8f796 100644 --- a/kernel/sched/fair.c

[RFC 45/60] cosched: Continue to account all load on per-CPU runqueues

2018-09-07 Thread Jan H . Schönherr
er-CPU runqueues. The change in set_next_entity() just silences a warning. The code looks bogus even without coscheduling, as the weight of an SE is independent from the weight of the runqueue, when task groups are involved. It's just for statistics anyway. Signed-off-by: Jan H. Schönherr --- kernel

[RFC 43/60] cosched: Add for_each_sched_entity() variant for owned entities

2018-09-07 Thread Jan H . Schönherr
. Include some lockdep goodness, so that we detect incorrect usage. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 70 + 1 file changed, 70 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f72a72c8c3b8

[RFC 45/60] cosched: Continue to account all load on per-CPU runqueues

2018-09-07 Thread Jan H . Schönherr
er-CPU runqueues. The change in set_next_entity() just silences a warning. The code looks bogus even without coscheduling, as the weight of an SE is independent from the weight of the runqueue, when task groups are involved. It's just for statistics anyway. Signed-off-by: Jan H. Schönherr --- kernel

[RFC 43/60] cosched: Add for_each_sched_entity() variant for owned entities

2018-09-07 Thread Jan H . Schönherr
. Include some lockdep goodness, so that we detect incorrect usage. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 70 + 1 file changed, 70 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f72a72c8c3b8

[RFC 49/60] cosched: Adjust locking for enqueuing and dequeueing

2018-09-07 Thread Jan H . Schönherr
that only one of multiple CPUs has to walk up the hierarchy. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 33 + 1 file changed, 33 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6d64f4478fda..0dc4d289497c 100644

[RFC 50/60] cosched: Propagate load changes across hierarchy levels

2018-09-07 Thread Jan H . Schönherr
we perform the actual SD-SE weight adjustment via update_sdse_load(). At some point in the future (the code isn't there yet), this will allow software combining, where not all CPUs have to walk up the full hierarchy on enqueue/dequeue. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c |

[RFC 47/60] cosched: Adjust SE traversal and locking for common leader activities

2018-09-07 Thread Jan H . Schönherr
) putting the current task back. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2aa3a60dfca5..2227e4840355 100644 --- a/kernel/sched/fair.c

[RFC 49/60] cosched: Adjust locking for enqueuing and dequeueing

2018-09-07 Thread Jan H . Schönherr
that only one of multiple CPUs has to walk up the hierarchy. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 33 + 1 file changed, 33 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6d64f4478fda..0dc4d289497c 100644

[RFC 50/60] cosched: Propagate load changes across hierarchy levels

2018-09-07 Thread Jan H . Schönherr
we perform the actual SD-SE weight adjustment via update_sdse_load(). At some point in the future (the code isn't there yet), this will allow software combining, where not all CPUs have to walk up the full hierarchy on enqueue/dequeue. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c |

[RFC 47/60] cosched: Adjust SE traversal and locking for common leader activities

2018-09-07 Thread Jan H . Schönherr
) putting the current task back. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2aa3a60dfca5..2227e4840355 100644 --- a/kernel/sched/fair.c

[RFC 51/60] cosched: Hacky work-around to avoid observing zero weight SD-SE

2018-09-07 Thread Jan H . Schönherr
bumping the aggregated value. (A nicer solution would be to apply only the actual difference to the aggregate instead of doing full removal and a subsequent addition.) Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 15 +++ 1 file changed, 15 insertions(+) diff --git

[RFC 51/60] cosched: Hacky work-around to avoid observing zero weight SD-SE

2018-09-07 Thread Jan H . Schönherr
bumping the aggregated value. (A nicer solution would be to apply only the actual difference to the aggregate instead of doing full removal and a subsequent addition.) Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 15 +++ 1 file changed, 15 insertions(+) diff --git

[RFC 16/60] sched: Preparatory code movement

2018-09-07 Thread Jan H . Schönherr
Move struct rq_flags around to keep future commits crisp. Signed-off-by: Jan H. Schönherr --- kernel/sched/sched.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index b8c8dfd0e88d..cd3a32ce8fc6 100644

[RFC 24/60] cosched: Do minimal pre-SMP coscheduler initialization

2018-09-07 Thread Jan H . Schönherr
Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c| 2 ++ kernel/sched/cosched.c | 85 ++ kernel/sched/sched.h | 6 3 files changed, 93 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 48e37c3baed1..a235b6041

[RFC 38/60] cosched: Skip updates on non-CPU runqueues in cfs_rq_util_change()

2018-09-07 Thread Jan H . Schönherr
The function cfs_rq_util_change() notifies frequency governors of utilization changes, so that they can be scheduler driven. This is coupled to per CPU runqueue statistics. So, don't do anything when called for non-CPU runqueues. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 11

[RFC 16/60] sched: Preparatory code movement

2018-09-07 Thread Jan H . Schönherr
Move struct rq_flags around to keep future commits crisp. Signed-off-by: Jan H. Schönherr --- kernel/sched/sched.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index b8c8dfd0e88d..cd3a32ce8fc6 100644

[RFC 24/60] cosched: Do minimal pre-SMP coscheduler initialization

2018-09-07 Thread Jan H . Schönherr
Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c| 2 ++ kernel/sched/cosched.c | 85 ++ kernel/sched/sched.h | 6 3 files changed, 93 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 48e37c3baed1..a235b6041

[RFC 38/60] cosched: Skip updates on non-CPU runqueues in cfs_rq_util_change()

2018-09-07 Thread Jan H . Schönherr
The function cfs_rq_util_change() notifies frequency governors of utilization changes, so that they can be scheduler driven. This is coupled to per CPU runqueue statistics. So, don't do anything when called for non-CPU runqueues. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 11

[RFC 11/60] locking/lockdep: Increase number of supported lockdep subclasses

2018-09-07 Thread Jan H . Schönherr
With coscheduling the number of required classes is twice the depth of the scheduling domain hierarchy. For a 256 CPU system, there are eight levels at most. Adjust the number of subclasses, so that lockdep can still be used on such systems. Signed-off-by: Jan H. Schönherr --- include/linux

[RFC 11/60] locking/lockdep: Increase number of supported lockdep subclasses

2018-09-07 Thread Jan H . Schönherr
With coscheduling the number of required classes is twice the depth of the scheduling domain hierarchy. For a 256 CPU system, there are eight levels at most. Adjust the number of subclasses, so that lockdep can still be used on such systems. Signed-off-by: Jan H. Schönherr --- include/linux

[RFC 59/60] cosched: Handle non-atomicity during switches to and from coscheduling

2018-09-07 Thread Jan H . Schönherr
, where the sdrq->is_root fields do not yield a consistent picture across a task group. Handle these cases. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 68 + 1 file changed, 68 insertions(+) diff --git a/kernel/sched/fair.

[RFC 59/60] cosched: Handle non-atomicity during switches to and from coscheduling

2018-09-07 Thread Jan H . Schönherr
, where the sdrq->is_root fields do not yield a consistent picture across a task group. Handle these cases. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 68 + 1 file changed, 68 insertions(+) diff --git a/kernel/sched/fair.

[RFC 29/60] cosched: Adjust code reflecting on the total number of CFS tasks on a CPU

2018-09-07 Thread Jan H . Schönherr
off-by: Jan H. Schönherr --- kernel/sched/core.c | 5 ++--- kernel/sched/fair.c | 11 +-- kernel/sched/sched.h | 21 + 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5350cab7ac4a..337bae6fa836 100

[RFC 17/60] sched: Introduce and use generic task group CFS traversal functions

2018-09-07 Thread Jan H . Schönherr
ent group to create a new group. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 64 +++- kernel/sched/sched.h | 31 + 2 files changed, 59 insertions(+), 36 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sc

[RFC 56/60] cosched: Adjust wakeup preemption rules for coscheduling

2018-09-07 Thread Jan H . Schönherr
, we need to handle additional idle cases, as CPUs are now idle *within* certain coscheduled sets and woken tasks may not preempt the idle task blindly anymore. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 85 +++-- 1 file changed, 83

[RFC 60/60] cosched: Add command line argument to enable coscheduling

2018-09-07 Thread Jan H . Schönherr
transparently to system level. Signed-off-by: Jan H. Schönherr --- kernel/sched/cosched.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/kernel/sched/cosched.c b/kernel/sched/cosched.c index eb6a6a61521e..a1f0d3a7b02a 100644 --- a/kernel/sched

[RFC 03/60] sched: Setup sched_domain_shared for all sched_domains

2018-09-07 Thread Jan H . Schönherr
r use case. This will change soon. Also, move the structure definition below kernel/sched/. It is not used outside and in the future it will carry some more internal types that we don't want to expose. Signed-off-by: Jan H. Schönherr --- include/linux/sched/topology.h | 6 -- kernel/sch

[RFC 29/60] cosched: Adjust code reflecting on the total number of CFS tasks on a CPU

2018-09-07 Thread Jan H . Schönherr
off-by: Jan H. Schönherr --- kernel/sched/core.c | 5 ++--- kernel/sched/fair.c | 11 +-- kernel/sched/sched.h | 21 + 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5350cab7ac4a..337bae6fa836 100

  1   2   3   >