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, 19

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, should

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 this

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 windo

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 be

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

2019-02-14 Thread Jan H . Schönherr
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
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
PU16 in my 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 de

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

[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 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 libvirt

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 >&

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 want

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 want t

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 grou

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

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

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

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

2018-09-13 Thread Jan H . Schönherr
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] rq->

[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

[RFC 00/60] Coscheduling for Linux

2018-09-07 Thread Jan H . Schönherr
unctionality. Highlights 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 C

[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 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 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 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/f

[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 --- k

[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 --- a

[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/fai

[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
arily 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 --

[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
ned-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

[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 29/60] cosched: Adjust code reflecting on the total number of CFS tasks on a CPU

2018-09-07 Thread Jan H . Schönherr
-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 100644 --

[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
hand, 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 change

[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
of another 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 ---

[RFC 48/60] cosched: Adjust SE traversal and locking for yielding and buddies

2018-09-07 Thread Jan H . Schönherr
-by: Jan H. Schönherr --- kernel/sched/fair.c | 51 ++- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2227e4840355..6d64f4478fda 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c

[RFC 58/60] cosched: Switch runqueues between regular scheduling and coscheduling

2018-09-07 Thread Jan H . Schönherr
U0 1 2 3 0 1 2 3 Signed-off-by: Jan H. Schönherr --- kernel/sched/cosched.c | 138 - kernel/sched/fair.c| 14 - kernel/sched/sched.h | 2 + 3 files changed, 151 insertions(+), 3 deletions(-) diff --git a/kernel/sched/cosc

[RFC 46/60] cosched: Warn on throttling attempts of non-CPU runqueues

2018-09-07 Thread Jan H . Schönherr
nse from a coscheduling perspective). Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0bba924b40ba..2aa3a60dfca5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sc

[RFC 42/60] cosched: Introduce locking for (mostly) enqueuing and dequeuing

2018-09-07 Thread Jan H . Schönherr
parts have already been locked via rq_lock_owned(), as for example dequeueing might happen during task selection if a runqueue is throttled. Signed-off-by: Jan H. Schönherr --- kernel/sched/cosched.c | 53 ++ kernel/sched/sched.h | 14

[RFC 32/60] cosched: Specialize parent_cfs_rq() for hierarchical runqueues

2018-09-07 Thread Jan H . Schönherr
Make parent_cfs_rq() coscheduling-aware. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 13 + 1 file changed, 13 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8504790944bf..8cba7b8fb6bd 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched

[RFC 12/60] locking/lockdep: Make cookie generator accessible

2018-09-07 Thread Jan H . Schönherr
If a dynamic amount of locks needs to be pinned in the same context, it is impractical to have a cookie per lock. Make the cookie generator accessible, so that such a group of locks can be (re-)pinned with just one (shared) cookie. Signed-off-by: Jan H. Schönherr --- include/linux/lockdep.h

[RFC 33/60] cosched: Allow resched_curr() to be called for hierarchical runqueues

2018-09-07 Thread Jan H . Schönherr
which is needed for resched_curr() to work. Therefore, fall back to resched_cpu_locked() on higher levels. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c | 5 + 1 file changed, 5 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 337bae6fa836..c4358396f588 1

[RFC 28/60] cosched: Add is_sd_se() to distinguish SD-SEs from TG-SEs

2018-09-07 Thread Jan H . Schönherr
SD-SEs. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 12 +--- kernel/sched/sched.h | 14 ++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 18b1d81951f1..9cbdd027d449 100644 --- a/kernel/sched/fair.c

[RFC 23/60] cosched: Add core data structures for coscheduling

2018-09-07 Thread Jan H . Schönherr
hierarchical aspect and represent SEs of a lower hierarchy level at a higher level within the parent task group, causing SEs at the lower level to get coscheduled. Signed-off-by: Jan H. Schönherr --- kernel/sched/sched.h | 151 +++ 1 file changed, 151

[RFC 18/60] sched: Fix return value of SCHED_WARN_ON()

2018-09-07 Thread Jan H . Schönherr
, without CONFIG_SCHED_DEBUG, SCHED_WARN_ON() evaluates to false unconditionally. Change SCHED_WARN_ON() to not discard the WARN_ON condition, even without CONFIG_SCHED_DEBUG, so that it can be used within if() statements as expected. Signed-off-by: Jan H. Schönherr --- kernel/sched/sched.h | 2

[RFC 10/60] sched: Use parent_entity() in more places

2018-09-07 Thread Jan H . Schönherr
Replace open-coded cases of parent_entity() with actual parent_entity() invocations. This will make later checks within parent_entity() more useful. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched

[RFC 36/60] cosched: Use hrq_of() for rq_clock() and rq_clock_task()

2018-09-07 Thread Jan H . Schönherr
We use and keep rq->clock updated on all hierarchical runqueues. In fact, not using the hierarchical runqueue would be incorrect as there is no guarantee that the leader's CPU runqueue clock is updated. Switch all obvious cases from rq_of() to hrq_of(). Signed-off-by: Jan H. S

[RFC 13/60] sched: Remove useless checks for root task-group

2018-09-07 Thread Jan H . Schönherr
The functions sync_throttle() and unregister_fair_sched_group() are called during the creation and destruction of cgroups. They are never called for the root task-group. Remove checks that always yield the same result when operating on non-root task groups. Signed-off-by: Jan H. Schönherr

[RFC 08/60] sched: Move init_entity_runnable_average() into init_tg_cfs_entry()

2018-09-07 Thread Jan H . Schönherr
Move init_entity_runnable_average() into init_tg_cfs_entry(), where all the other SE initialization is carried out. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index

[RFC 27/60] cosched: Add some small helper functions for later use

2018-09-07 Thread Jan H . Schönherr
Signed-off-by: Jan H. Schönherr --- kernel/sched/sched.h | 34 ++ 1 file changed, 34 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index d65c98c34c13..456b266b8a2c 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1130,6

[RFC 07/60] sched: Reduce dependencies of init_tg_cfs_entry()

2018-09-07 Thread Jan H . Schönherr
Decouple init_tg_cfs_entry() from other structures' implementation details, so that it only updates/accesses task group related fields of the CFS runqueue and its SE. This prepares calling this function in slightly different contexts. Signed-off-by: Jan H. Schönherr --- kernel/sched/c

[RFC 55/60] cosched: Adjust task selection for coscheduling

2018-09-07 Thread Jan H . Schönherr
find something to execute, then we force the CPU into idle. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 150 +++- 1 file changed, 137 insertions(+), 13 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9e8b811

[RFC 41/60] cosched: Introduce locking for leader activities

2018-09-07 Thread Jan H . Schönherr
locked per-CPU runqueue upwards, locking/unlocking runqueues as they go along, stopping when they would leave their area of responsibility. Signed-off-by: Jan H. Schönherr --- kernel/sched/cosched.c | 94 ++ kernel/sched/sched.h | 11 ++ 2

[RFC 54/60] cosched: Support idling in a coscheduled set

2018-09-07 Thread Jan H . Schönherr
actual decisions on the (SD-)SE, under which there were no tasks. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c | 11 +++ kernel/sched/fair.c | 43 +--- kernel/sched/idle.c | 7 ++- kernel/sched/sched.h | 55

[RFC 57/60] cosched: Add sysfs interface to configure coscheduling on cgroups

2018-09-07 Thread Jan H . Schönherr
beyond that of the root task group. The value for the root task group cannot be configured via this interface. It has to be configured with a command line argument, which will be added later. The function sdrq_update_root() will be filled in a follow-up commit. Signed-off-by: Jan H. Schönherr

[RFC 52/60] cosched: Support SD-SEs in enqueuing and dequeuing

2018-09-07 Thread Jan H . Schönherr
Jan H. Schönherr --- kernel/sched/fair.c | 107 +--- 1 file changed, 102 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 483db54ee20a..bc219c9c3097 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fai

[RFC 44/60] cosched: Perform various rq_of() adjustments in scheduler code

2018-09-07 Thread Jan H . Schönherr
queue. This is used during load balancing. We keep these lists per hierarchy level, which corresponds to the lock we hold and also keeps the per-CPU logic compatible to what is there. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 12 ++-- 1 file changed, 6 insertions(+), 6 dele

[RFC 40/60] cosched: Keep track of task group hierarchy within each SD-RQ

2018-09-07 Thread Jan H . Schönherr
. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c| 2 ++ kernel/sched/cosched.c | 19 +++ kernel/sched/sched.h | 4 3 files changed, 25 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a9f5339d58cb..b3ff885a88d4 100644 --- a/kernel/sched

[RFC 53/60] cosched: Prevent balancing related functions from crossing hierarchy levels

2018-09-07 Thread Jan H . Schönherr
Modify update_blocked_averages() and update_cfs_rq_h_load() so that they won't access the next higher hierarchy level, for which they don't hold a lock. This will have to be touched again, when load balancing is made functional. Signed-off-by: Jan H. Schönherr --- kernel/sched/

[RFC 21/60] sched: Add entity variants of put_prev_task_fair() and set_curr_task_fair()

2018-09-07 Thread Jan H . Schönherr
Add entity variants of put_prev_task_fair() and set_curr_task_fair() that will be later used by coscheduling. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 34 +- kernel/sched/sched.h | 2 ++ 2 files changed, 23 insertions(+), 13 deletions(-) diff

[RFC 35/60] cosched: Adjust rq_lock() functions to work with hierarchical runqueues

2018-09-07 Thread Jan H . Schönherr
Locks within the runqueue hierarchy are always taken from bottom to top to avoid deadlocks. Let the lock validator know about this by declaring different runqueue levels as distinct lock classes. Signed-off-by: Jan H. Schönherr --- kernel/sched/sched.h | 29 ++--- 1 file

[RFC 25/60] cosched: Prepare scheduling domain topology for coscheduling

2018-09-07 Thread Jan H . Schönherr
rithm operating on the NUMA distance matrix. Also, as mentioned before, not everyone needs the finer granularity. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c| 1 + kernel/sched/cosched.c | 259 + kernel/sched/sched.h | 2 + 3

[RFC 31/60] cosched: Don't disable idle tick for now

2018-09-07 Thread Jan H . Schönherr
from disabling NOHZ and allows us to gradually improve the situation later. Signed-off-by: Jan H. Schönherr --- kernel/time/tick-sched.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 5b33e2f5c0ed..5e9c2a7d4ea9 100644

[RFC 19/60] sched: Add entity variants of enqueue_task_fair() and dequeue_task_fair()

2018-09-07 Thread Jan H . Schönherr
There is fair amount of overlap between enqueue_task_fair() and unthrottle_cfs_rq(), as well as between dequeue_task_fair() and throttle_cfs_rq(). This is the first step toward having both of them use the same basic function. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 82

[RFC 20/60] sched: Let {en,de}queue_entity_fair() work with a varying amount of tasks

2018-09-07 Thread Jan H . Schönherr
Make the task delta handled by enqueue_entity_fair() and dequeue_task_fair() variable as required by unthrottle_cfs_rq() and throttle_cfs_rq(). Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 18 ++ kernel/sched/sched.h | 6 -- 2 files changed, 14 insertions

[RFC 04/60] sched: Replace sd_numa_mask() hack with something sane

2018-09-07 Thread Jan H . Schönherr
to what NUMA already does on top of the system topology). Signed-off-by: Jan H. Schönherr --- include/linux/sched/topology.h | 11 --- kernel/sched/topology.c| 40 ++-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/include

[RFC 09/60] sched: Do not require a CFS in init_tg_cfs_entry()

2018-09-07 Thread Jan H . Schönherr
Just like init_tg_cfs_entry() does something useful without a scheduling entity, let it do something useful without a CFS runqueue. This prepares for the addition of new types of SEs. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 28 +++- 1 file changed, 15

[RFC 05/60] sched: Allow to retrieve the sched_domain_topology

2018-09-07 Thread Jan H . Schönherr
sched_domain_topology is replaced with another one. Signed-off-by: Jan H. Schönherr --- include/linux/sched/topology.h | 1 + kernel/sched/topology.c| 5 + 2 files changed, 6 insertions(+) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index

[RFC 02/60] sched: Introduce set_entity_cfs() to place a SE into a certain CFS runqueue

2018-09-07 Thread Jan H . Schönherr
Factor out the logic to place a SE into a CFS runqueue into its own function. This consolidates various sprinkled updates of se->cfs_rq, se->parent, and se->depth at the cost of updating se->depth unnecessarily on same-group movements between CPUs. Signed-off-by: Jan H. Schönherr

[PATCH v2] x86: e820: Implement a range manipulation operator

2018-02-02 Thread Jan H . Schönherr
s not specified, the memory is removed from the e820 map. Signed-off-by: Jan H. Schönherr --- v2: Small coding style and typography adjustments Documentation/admin-guide/kernel-parameters.txt | 9 + arch/x86/kernel/e820.c | 18 ++ 2 files ch

Re: [PATCH] x86: e820: Implement a range manipulation operator

2018-02-02 Thread Jan H. Schönherr
On 02/02/2018 09:50 PM, Andy Shevchenko wrote: > On Fri, Feb 2, 2018 at 1:13 AM, Jan H. Schönherr wrote: > >> + [KNL,ACPI] Convert memory within the specified region >> + from to . If "-" is left >> +

[PATCH] x86: e820: Implement a range manipulation operator

2018-02-01 Thread Jan H . Schönherr
s not specified, the memory is removed from the e820 map. Signed-off-by: Jan H. Schönherr --- Documentation/admin-guide/kernel-parameters.txt | 9 + arch/x86/kernel/e820.c | 18 ++ 2 files changed, 27 insertions(+) diff --git a/Documentatio

[PATCH 2/2] mm: Fix devm_memremap_pages() collision handling

2018-01-17 Thread Jan H . Schönherr
additional argument to indicate where to stop, so that only newly added entries are removed from the tree. Fixes: 9476df7d80df ("mm: introduce find_dev_pagemap()") Signed-off-by: Jan H. Schönherr --- kernel/memremap.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) di

[PATCH 1/2] mm: Fix memory size alignment in devm_memremap_pages_release()

2018-01-17 Thread Jan H . Schönherr
("mm: fix mixed zone detection in devm_memremap_pages") Signed-off-by: Jan H. Schönherr --- kernel/memremap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/memremap.c b/kernel/memremap.c index 403ab9c..4712ce6 100644 --- a/kernel/memremap.c +++ b/kernel/

[PATCH] Revert "KVM: Don't accept obviously wrong gsi values via KVM_IRQFD"

2017-09-16 Thread Jan H . Schönherr
wrong, reverting just restores the previous behavior where overly large values are ignored when encountered (without any direct feedback). Reported-by: Abdul Haleem Signed-off-by: Jan H. Schönherr --- virt/kvm/eventfd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/virt/kvm/eventfd.c b

Re: [mainline][bisected 36ae3c0] Build fail at virt/kvm/eventfd.c:568

2017-09-16 Thread Jan H. Schönherr
strictly needed -- unless someone else can provide more insight on valid values for GSI. Paolo, do you want me to prepare a revert for the commit below? Regards Jan > Possible bad commit is : > > commit 36ae3c0a36b7456432fedce38ae2f7bd3e01a563 > Author: Jan H. Schönherr > Date

[PATCH] x86/boot: Prevent faulty bootparams.screeninfo from causing harm

2017-08-27 Thread Jan H . Schönherr
If a zero for the number of lines manages to slip through, scroll() may underflow some offset calculations, causing accesses outside the video memory. Make the check in __putstr() more pessimistic to prevent that. Signed-off-by: Jan H. Schönherr --- arch/x86/boot/compressed/misc.c | 3 +-- 1

[PATCH] x86/boot: provide more slack space during decompression

2017-08-27 Thread Jan H . Schönherr
The current slack space is not enough for LZ4, which has a worst case overhead of 0.4% for data that cannot be further compressed. With an LZ4 compressed kernel with an embedded initrd, the output is likely to overwrite the input. Increase the slack space to avoid that. Signed-off-by: Jan H

  1   2   >