Commit Graph

690 Commits

Author SHA1 Message Date
balgxmr
434f599332 Merge branch 'upstream-linux-4.14.y' of https://android.googlesource.com/kernel/common into rebase 2023-08-09 16:44:33 -05:00
Linus Torvalds
dad6ca557f proc: proc_skip_spaces() shouldn't think it is working on C strings
commit bce9332220bd677d83b19d21502776ad555a0e73 upstream.

proc_skip_spaces() seems to think it is working on C strings, and ends
up being just a wrapper around skip_spaces() with a really odd calling
convention.

Instead of basing it on skip_spaces(), it should have looked more like
proc_skip_char(), which really is the exact same function (except it
skips a particular character, rather than whitespace).  So use that as
inspiration, odd coding and all.

Now the calling convention actually makes sense and works for the
intended purpose.

Reported-and-tested-by: Kyle Zeng <zengyhkyle@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-08 11:16:33 +01:00
Linus Torvalds
4f4ff21bbc proc: avoid integer type confusion in get_proc_long
commit e6cfaf34be9fcd1a8285a294e18986bfc41a409c upstream.

proc_get_long() is passed a size_t, but then assigns it to an 'int'
variable for the length.  Let's not do that, even if our IO paths are
limited to MAX_RW_COUNT (exactly because of these kinds of type errors).

So do the proper test in the rigth type.

Reported-by: Kyle Zeng <zengyhkyle@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-08 11:16:33 +01:00
baalgx
4760bf9f5d Merge remote-tracking branch 'soviet-up/13.0' into thirteen 2022-11-30 17:19:51 -05:00
John Galt
5697d1dc9a Partial Revert "mm + sysctl: tune swappiness and make some values read only"
This reverts commit 4a63603eb76ffbfb757cc450e85f931e071e1184.

Userspace should now be able to modify these values.
2022-11-30 10:39:43 +02:00
baalgx
a585a8d508 Merge remote-tracking branch 'soviet/13.0' into soviet-13 2022-11-05 17:05:43 -05:00
kondors1995
c89ee9365b Revert "mm: Import oplus memory management hacks"
This reverts commit 5babd23106.
2022-10-17 12:50:34 +03:00
pwnrazr
a8ea33e97f Revert "Revert "[SQUASH] mm: revert recent changes to kswpad""
This reverts commit 4df043fc41bbb86de9a0d36c3f1989884ad49edb.
2022-10-07 12:15:36 +03:00
Kees Cook
84e16102a1 treewide: kzalloc() -> kcalloc()
The kzalloc() function has a 2-factor argument form, kcalloc(). This
patch replaces cases of:

        kzalloc(a * b, gfp)

with:
        kcalloc(a * b, gfp)

as well as handling cases of:

        kzalloc(a * b * c, gfp)

with:

        kzalloc(array3_size(a, b, c), gfp)

as it's slightly less ugly than:

        kzalloc_array(array_size(a, b), c, gfp)

This does, however, attempt to ignore constant size factors like:

        kzalloc(4 * 1024, gfp)

though any constants defined via macros get caught up in the conversion.

Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.

The Coccinelle script used for this was:

// Fix redundant parens around sizeof().
@@
type TYPE;
expression THING, E;
@@

(
  kzalloc(
-	(sizeof(TYPE)) * E
+	sizeof(TYPE) * E
  , ...)
|
  kzalloc(
-	(sizeof(THING)) * E
+	sizeof(THING) * E
  , ...)
)

// Drop single-byte sizes and redundant parens.
@@
expression COUNT;
typedef u8;
typedef __u8;
@@

(
  kzalloc(
-	sizeof(u8) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(__u8) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(char) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(unsigned char) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(u8) * COUNT
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(__u8) * COUNT
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(char) * COUNT
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(unsigned char) * COUNT
+	COUNT
  , ...)
)

// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@

(
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * (COUNT_ID)
+	COUNT_ID, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * COUNT_ID
+	COUNT_ID, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * (COUNT_CONST)
+	COUNT_CONST, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * COUNT_CONST
+	COUNT_CONST, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * (COUNT_ID)
+	COUNT_ID, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * COUNT_ID
+	COUNT_ID, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * (COUNT_CONST)
+	COUNT_CONST, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * COUNT_CONST
+	COUNT_CONST, sizeof(THING)
  , ...)
)

// 2-factor product, only identifiers.
@@
identifier SIZE, COUNT;
@@

- kzalloc
+ kcalloc
  (
-	SIZE * COUNT
+	COUNT, SIZE
  , ...)

// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@

(
  kzalloc(
-	sizeof(TYPE) * (COUNT) * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(TYPE) * (COUNT) * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(TYPE) * COUNT * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(TYPE) * COUNT * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(THING) * (COUNT) * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
|
  kzalloc(
-	sizeof(THING) * (COUNT) * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
|
  kzalloc(
-	sizeof(THING) * COUNT * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
|
  kzalloc(
-	sizeof(THING) * COUNT * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
)

// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@

(
  kzalloc(
-	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
  , ...)
|
  kzalloc(
-	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
  , ...)
|
  kzalloc(
-	sizeof(THING1) * sizeof(THING2) * COUNT
+	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
  , ...)
|
  kzalloc(
-	sizeof(THING1) * sizeof(THING2) * (COUNT)
+	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
  , ...)
|
  kzalloc(
-	sizeof(TYPE1) * sizeof(THING2) * COUNT
+	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
  , ...)
|
  kzalloc(
-	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
  , ...)
)

// 3-factor product, only identifiers, with redundant parens removed.
@@
identifier STRIDE, SIZE, COUNT;
@@

(
  kzalloc(
-	(COUNT) * STRIDE * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * (STRIDE) * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * STRIDE * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	(COUNT) * (STRIDE) * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * (STRIDE) * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	(COUNT) * STRIDE * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	(COUNT) * (STRIDE) * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * STRIDE * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
)

// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression E1, E2, E3;
constant C1, C2, C3;
@@

(
  kzalloc(C1 * C2 * C3, ...)
|
  kzalloc(
-	(E1) * E2 * E3
+	array3_size(E1, E2, E3)
  , ...)
|
  kzalloc(
-	(E1) * (E2) * E3
+	array3_size(E1, E2, E3)
  , ...)
|
  kzalloc(
-	(E1) * (E2) * (E3)
+	array3_size(E1, E2, E3)
  , ...)
|
  kzalloc(
-	E1 * E2 * E3
+	array3_size(E1, E2, E3)
  , ...)
)

// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@

(
  kzalloc(sizeof(THING) * C2, ...)
|
  kzalloc(sizeof(TYPE) * C2, ...)
|
  kzalloc(C1 * C2 * C3, ...)
|
  kzalloc(C1 * C2, ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * (E2)
+	E2, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * E2
+	E2, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * (E2)
+	E2, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * E2
+	E2, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	(E1) * E2
+	E1, E2
  , ...)
|
- kzalloc
+ kcalloc
  (
-	(E1) * (E2)
+	E1, E2
  , ...)
|
- kzalloc
+ kcalloc
  (
-	E1 * E2
+	E1, E2
  , ...)
)

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
[fiqri19102002: Adapt to new extcon.c changes]
Signed-off-by: Fiqri Ardyansyah <fiqri15072019@gmail.com>

 Conflicts:
	arch/arm64/mm/context.c
pwnrazr: an upstream commit conflicted, but I think upstream one is better?
	Original commit: 299d38205a
	`bitmap_zalloc`
2022-10-07 11:26:56 +03:00
Sultan Alsawaf
ad1e591c0a sysctl: Nuke sched_boost feature
This is perhaps the worst performance-related feature ever, and is
thoroughly abused by userspace in all the worst ways possible.
Triggering a massive task migration via sched_boost during
latency-critical operations such as app launches is a very bad idea, and
leads to noticeably-horrible stuttering.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2022-09-22 22:47:07 -05:00
Daniel Micay
47f098408c add toggle for disabling newly added USB devices
Based on the public grsecurity patches.

Change-Id: I2cbea91b351cda7d098f4e1aa73dff1acbd23cce
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
2022-09-22 17:33:54 +03:00
kondors1995
435cf700fa Revert "Revert "sched: separate capacity margin for boosted tasks""
This reverts commit 834e38ed40.
2022-09-22 17:33:17 +03:00
Qais Yousef
1abcbcbea7 BACKPORT: sched/uclamp: Add a new sysctl to control RT default boost value
RT tasks by default run at the highest capacity/performance level. When
uclamp is selected this default behavior is retained by enforcing the
requested uclamp.min (p->uclamp_req[UCLAMP_MIN]) of the RT tasks to be
uclamp_none(UCLAMP_MAX), which is SCHED_CAPACITY_SCALE; the maximum
value.

This is also referred to as 'the default boost value of RT tasks'.

See commit 1a00d999971c ("sched/uclamp: Set default clamps for RT tasks").

On battery powered devices, it is desired to control this default
(currently hardcoded) behavior at runtime to reduce energy consumed by
RT tasks.

For example, a mobile device manufacturer where big.LITTLE architecture
is dominant, the performance of the little cores varies across SoCs, and
on high end ones the big cores could be too power hungry.

Given the diversity of SoCs, the new knob allows manufactures to tune
the best performance/power for RT tasks for the particular hardware they
run on.

They could opt to further tune the value when the user selects
a different power saving mode or when the device is actively charging.

The runtime aspect of it further helps in creating a single kernel image
that can be run on multiple devices that require different tuning.

Keep in mind that a lot of RT tasks in the system are created by the
kernel. On Android for instance I can see over 50 RT tasks, only
a handful of which created by the Android framework.

To control the default behavior globally by system admins and device
integrator, introduce the new sysctl_sched_uclamp_util_min_rt_default
to change the default boost value of the RT tasks.

I anticipate this to be mostly in the form of modifying the init script
of a particular device.

To avoid polluting the fast path with unnecessary code, the approach
taken is to synchronously do the update by traversing all the existing
tasks in the system. This could race with a concurrent fork(), which is
dealt with by introducing sched_post_fork() function which will ensure
the racy fork will get the right update applied.

Tested on Juno-r2 in combination with the RT capacity awareness [1].
By default an RT task will go to the highest capacity CPU and run at the
maximum frequency, which is particularly energy inefficient on high end
mobile devices because the biggest core[s] are 'huge' and power hungry.

With this patch the RT task can be controlled to run anywhere by
default, and doesn't cause the frequency to be maximum all the time.
Yet any task that really needs to be boosted can easily escape this
default behavior by modifying its requested uclamp.min value
(p->uclamp_req[UCLAMP_MIN]) via sched_setattr() syscall.

[1] 804d402fb6f6: ("sched/rt: Make RT capacity-aware")

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200716110347.19553-2-qais.yousef@arm.com

(cherry picked from commit 13685c4a08fca9dd76bf53bfcbadc044ab2a08cb)

Conflicts:
   kernel/fork.c
   kernel/sysctl.c
Upstream has commit 5a5cf5cb30d7 ("cgroup: refactor fork helpers") and
further commit ef2c41cf38a7 ("clone3: allow spawning processes into
cgroups") which affect the calls after this.  Picking the first would
be easy but the 2nd would be much bigger.  Also, my cherry-pick put my
sysctl in the wrong place in the table in sysctl.c, so I manually
moved it.  Weird.

BUG=b:160171130
TEST=With series rt tasks don't get boosted

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Change-Id: I678d8ee899ecfbe0a1f0bb94da85d54fff924a57
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2340433
Reviewed-by: Joel Fernandes <joelaf@google.com>
2022-09-22 17:33:16 +03:00
Patrick Bellasi
5bee2de619 UPSTREAM: sched/uclamp: Add system default clamps
Tasks without a user-defined clamp value are considered not clamped
and by default their utilization can have any value in the
[0..SCHED_CAPACITY_SCALE] range.

Tasks with a user-defined clamp value are allowed to request any value
in that range, and the required clamp is unconditionally enforced.
However, a "System Management Software" could be interested in limiting
the range of clamp values allowed for all tasks.

Add a privileged interface to define a system default configuration via:

  /proc/sys/kernel/sched_uclamp_util_{min,max}

which works as an unconditional clamp range restriction for all tasks.

With the default configuration, the full SCHED_CAPACITY_SCALE range of
values is allowed for each clamp index. Otherwise, the task-specific
clamp is capped by the corresponding system default value.

Do that by tracking, for each task, the "effective" clamp value and
bucket the task has been refcounted in at enqueue time. This
allows to lazy aggregate "requested" and "system default" values at
enqueue time and simplifies refcounting updates at dequeue time.

The cached bucket ids are used to avoid (relatively) more expensive
integer divisions every time a task is enqueued.

An active flag is used to report when the "effective" value is valid and
thus the task is actually refcounted in the corresponding rq's bucket.

Bug: 120440300
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alessio Balsini <balsini@android.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Perret <quentin.perret@arm.com>
Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>
Cc: Steve Muckle <smuckle@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Todd Kjos <tkjos@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lkml.kernel.org/r/20190621084217.8167-5-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit e8f14172c6b11e9a86c65532497087f8eb0f91b1)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I4f014c5ec9c312aaad606518f6e205fd0cfbcaa2
Signed-off-by: Quentin Perret <qperret@google.com>
2022-09-22 17:33:14 +03:00
kondors1995
de83ab483e Revert "Revert "sched: separate capacity margin for boosted tasks""
This reverts commit 834e38ed40.
2022-09-16 20:06:07 +03:00
Qais Yousef
8992cfd584 BACKPORT: sched/uclamp: Add a new sysctl to control RT default boost value
RT tasks by default run at the highest capacity/performance level. When
uclamp is selected this default behavior is retained by enforcing the
requested uclamp.min (p->uclamp_req[UCLAMP_MIN]) of the RT tasks to be
uclamp_none(UCLAMP_MAX), which is SCHED_CAPACITY_SCALE; the maximum
value.

This is also referred to as 'the default boost value of RT tasks'.

See commit 1a00d999971c ("sched/uclamp: Set default clamps for RT tasks").

On battery powered devices, it is desired to control this default
(currently hardcoded) behavior at runtime to reduce energy consumed by
RT tasks.

For example, a mobile device manufacturer where big.LITTLE architecture
is dominant, the performance of the little cores varies across SoCs, and
on high end ones the big cores could be too power hungry.

Given the diversity of SoCs, the new knob allows manufactures to tune
the best performance/power for RT tasks for the particular hardware they
run on.

They could opt to further tune the value when the user selects
a different power saving mode or when the device is actively charging.

The runtime aspect of it further helps in creating a single kernel image
that can be run on multiple devices that require different tuning.

Keep in mind that a lot of RT tasks in the system are created by the
kernel. On Android for instance I can see over 50 RT tasks, only
a handful of which created by the Android framework.

To control the default behavior globally by system admins and device
integrator, introduce the new sysctl_sched_uclamp_util_min_rt_default
to change the default boost value of the RT tasks.

I anticipate this to be mostly in the form of modifying the init script
of a particular device.

To avoid polluting the fast path with unnecessary code, the approach
taken is to synchronously do the update by traversing all the existing
tasks in the system. This could race with a concurrent fork(), which is
dealt with by introducing sched_post_fork() function which will ensure
the racy fork will get the right update applied.

Tested on Juno-r2 in combination with the RT capacity awareness [1].
By default an RT task will go to the highest capacity CPU and run at the
maximum frequency, which is particularly energy inefficient on high end
mobile devices because the biggest core[s] are 'huge' and power hungry.

With this patch the RT task can be controlled to run anywhere by
default, and doesn't cause the frequency to be maximum all the time.
Yet any task that really needs to be boosted can easily escape this
default behavior by modifying its requested uclamp.min value
(p->uclamp_req[UCLAMP_MIN]) via sched_setattr() syscall.

[1] 804d402fb6f6: ("sched/rt: Make RT capacity-aware")

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200716110347.19553-2-qais.yousef@arm.com

(cherry picked from commit 13685c4a08fca9dd76bf53bfcbadc044ab2a08cb)

Conflicts:
   kernel/fork.c
   kernel/sysctl.c
Upstream has commit 5a5cf5cb30d7 ("cgroup: refactor fork helpers") and
further commit ef2c41cf38a7 ("clone3: allow spawning processes into
cgroups") which affect the calls after this.  Picking the first would
be easy but the 2nd would be much bigger.  Also, my cherry-pick put my
sysctl in the wrong place in the table in sysctl.c, so I manually
moved it.  Weird.

BUG=b:160171130
TEST=With series rt tasks don't get boosted

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Change-Id: I678d8ee899ecfbe0a1f0bb94da85d54fff924a57
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2340433
Reviewed-by: Joel Fernandes <joelaf@google.com>
2022-09-16 20:06:06 +03:00
Patrick Bellasi
6f4a026db1 UPSTREAM: sched/uclamp: Add system default clamps
Tasks without a user-defined clamp value are considered not clamped
and by default their utilization can have any value in the
[0..SCHED_CAPACITY_SCALE] range.

Tasks with a user-defined clamp value are allowed to request any value
in that range, and the required clamp is unconditionally enforced.
However, a "System Management Software" could be interested in limiting
the range of clamp values allowed for all tasks.

Add a privileged interface to define a system default configuration via:

  /proc/sys/kernel/sched_uclamp_util_{min,max}

which works as an unconditional clamp range restriction for all tasks.

With the default configuration, the full SCHED_CAPACITY_SCALE range of
values is allowed for each clamp index. Otherwise, the task-specific
clamp is capped by the corresponding system default value.

Do that by tracking, for each task, the "effective" clamp value and
bucket the task has been refcounted in at enqueue time. This
allows to lazy aggregate "requested" and "system default" values at
enqueue time and simplifies refcounting updates at dequeue time.

The cached bucket ids are used to avoid (relatively) more expensive
integer divisions every time a task is enqueued.

An active flag is used to report when the "effective" value is valid and
thus the task is actually refcounted in the corresponding rq's bucket.

Bug: 120440300
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alessio Balsini <balsini@android.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Perret <quentin.perret@arm.com>
Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>
Cc: Steve Muckle <smuckle@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Todd Kjos <tkjos@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lkml.kernel.org/r/20190621084217.8167-5-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit e8f14172c6b11e9a86c65532497087f8eb0f91b1)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I4f014c5ec9c312aaad606518f6e205fd0cfbcaa2
Signed-off-by: Quentin Perret <qperret@google.com>
2022-09-16 20:06:04 +03:00
John Galt
3121e5dc33 mm + sysctl: tune swappiness and make some values read only 2022-07-25 06:30:37 +00:00
Kazuki Hashimoto
5ee787faf5 mm: Make watermark_scale_factor read-only
init modifies this and makes mm worse. Thanks to arter97 for figuring
this out.

Reported-by: Juhyung Park <qkrwngud825@gmail.com>
Signed-off-by: Kazuki Hashimoto <kazukih@tuta.io>
2022-07-19 06:39:34 +00:00
Buddy Lumpkin
5950d42926 vmscan: Support multiple kswapd threads per node
Page replacement is handled in the Linux Kernel in one of two ways:

1) Asynchronously via kswapd
2) Synchronously, via direct reclaim

At page allocation time the allocating task is immediately given a page
from the zone free list allowing it to go right back to work doing
whatever it was doing; Probably directly or indirectly executing business
logic.

Just prior to satisfying the allocation, free pages is checked to see if
it has reached the zone low watermark and if so, kswapd is awakened.
Kswapd will start scanning pages looking for inactive pages to evict to
make room for new page allocations. The work of kswapd allows tasks to
continue allocating memory from their respective zone free list without
incurring any delay.

When the demand for free pages exceeds the rate that kswapd tasks can
supply them, page allocation works differently. Once the allocating task
finds that the number of free pages is at or below the zone min watermark,
the task will no longer pull pages from the free list. Instead, the task
will run the same CPU-bound routines as kswapd to satisfy its own
allocation by scanning and evicting pages. This is called a direct reclaim.

The time spent performing a direct reclaim can be substantial, often
taking tens to hundreds of milliseconds for small order0 allocations to
half a second or more for order9 huge-page allocations. In fact, kswapd is
not actually required on a linux system. It exists for the sole purpose of
optimizing performance by preventing direct reclaims.

When memory shortfall is sufficient to trigger direct reclaims, they can
occur in any task that is running on the system. A single aggressive
memory allocating task can set the stage for collateral damage to occur in
small tasks that rarely allocate additional memory. Consider the impact of
injecting an additional 100ms of latency when nscd allocates memory to
facilitate caching of a DNS query.

The presence of direct reclaims 10 years ago was a fairly reliable
indicator that too much was being asked of a Linux system. Kswapd was
likely wasting time scanning pages that were ineligible for eviction.
Adding RAM or reducing the working set size would usually make the problem
go away. Since then hardware has evolved to bring a new struggle for
kswapd. Storage speeds have increased by orders of magnitude while CPU
clock speeds stayed the same or even slowed down in exchange for more
cores per package. This presents a throughput problem for a single
threaded kswapd that will get worse with each generation of new hardware.

Test Details

NOTE: The tests below were run with shadow entries disabled. See the
associated patch and cover letter for details

The tests below were designed with the assumption that a kswapd bottleneck
is best demonstrated using filesystem reads. This way, the inactive list
will be full of clean pages, simplifying the analysis and allowing kswapd
to achieve the highest possible steal rate. Maximum steal rates for kswapd
are likely to be the same or lower for any other mix of page types on the
system.

Tests were run on a 2U Oracle X7-2L with 52 Intel Xeon Skylake 2GHz cores,
756GB of RAM and 8 x 3.6 TB NVMe Solid State Disk drives. Each drive has
an XFS file system mounted separately as /d0 through /d7. SSD drives
require multiple concurrent streams to show their potential, so I created
eleven 250GB zero-filled files on each drive so that I could test with
parallel reads.

The test script runs in multiple stages. At each stage, the number of dd
tasks run concurrently is increased by 2. I did not include all of the
test output for brevity.

During each stage dd tasks are launched to read from each drive in a round
robin fashion until the specified number of tasks for the stage has been
reached. Then iostat, vmstat and top are started in the background with 10
second intervals. After five minutes, all of the dd tasks are killed and
the iostat, vmstat and top output is parsed in order to report the
following:

CPU consumption
- sy - aggregate kernel mode CPU consumption from vmstat output. The value
       doesn't tend to fluctuate much so I just grab the highest value.
       Each sample is averaged over 10 seconds
- dd_cpu - for all of the dd tasks averaged across the top samples since
           there is a lot of variation.

Throughput
- in Kbytes
- Command is iostat -x -d 10 -g total

This first test performs reads using O_DIRECT in order to show the maximum
throughput that can be obtained using these drives. It also demonstrates
how rapidly throughput scales as the number of dd tasks are increased.

The dd command for this test looks like this:

Command Used: dd iflag=direct if=/d${i}/$n of=/dev/null bs=4M

Test #1: Direct IO
dd sy dd_cpu throughput
6  0  2.33   14726026.40
10 1  2.95   19954974.80
16 1  2.63   24419689.30
22 1  2.63   25430303.20
28 1  2.91   26026513.20
34 1  2.53   26178618.00
40 1  2.18   26239229.20
46 1  1.91   26250550.40
52 1  1.69   26251845.60
58 1  1.54   26253205.60
64 1  1.43   26253780.80
70 1  1.31   26254154.80
76 1  1.21   26253660.80
82 1  1.12   26254214.80
88 1  1.07   26253770.00
90 1  1.04   26252406.40

Throughput was close to peak with only 22 dd tasks. Very little system CPU
was consumed as expected as the drives DMA directly into the user address
space when using direct IO.

In this next test, the iflag=direct option is removed and we only run the
test until the pgscan_kswapd from /proc/vmstat starts to increment. At
that point metrics are parsed and reported and the pagecache contents are
dropped prior to the next test. Lather, rinse, repeat.

Test #2: standard file system IO, no page replacement
dd sy dd_cpu throughput
6  2  28.78  5134316.40
10 3  31.40  8051218.40
16 5  34.73  11438106.80
22 7  33.65  14140596.40
28 8  31.24  16393455.20
34 10 29.88  18219463.60
40 11 28.33  19644159.60
46 11 25.05  20802497.60
52 13 26.92  22092370.00
58 13 23.29  22884881.20
64 14 23.12  23452248.80
70 15 22.40  23916468.00
76 16 22.06  24328737.20
82 17 20.97  24718693.20
88 16 18.57  25149404.40
90 16 18.31  25245565.60

Each read has to pause after the buffer in kernel space is populated while
those pages are added to the pagecache and copied into the user address
space. For this reason, more parallel streams are required to achieve peak
throughput. The copy operation consumes substantially more CPU than direct
IO as expected.

The next test measures throughput after kswapd starts running. This is the
same test only we wait for kswapd to wake up before we start collecting
metrics. The script actually keeps track of a few things that were not
mentioned earlier. It tracks direct reclaims and page scans by watching
the metrics in /proc/vmstat. CPU consumption for kswapd is tracked the
same way it is tracked for dd.

Since the test is 100% reads, you can assume that the page steal rate for
kswapd and direct reclaims is almost identical to the scan rate.

Test #3: 1 kswapd thread per node
dd sy dd_cpu kswapd0 kswapd1 throughput  dr    pgscan_kswapd pgscan_direct
10 4  26.07  28.56   27.03   7355924.40  0     459316976     0
16 7  34.94  69.33   69.66   10867895.20 0     872661643     0
22 10 36.03  93.99   99.33   13130613.60 489   1037654473    11268334
28 10 30.34  95.90   98.60   14601509.60 671   1182591373    15429142
34 14 34.77  97.50   99.23   16468012.00 10850 1069005644    249839515
40 17 36.32  91.49   97.11   17335987.60 18903 975417728     434467710
46 19 38.40  90.54   91.61   17705394.40 25369 855737040     582427973
52 22 40.88  83.97   83.70   17607680.40 31250 709532935     724282458
58 25 40.89  82.19   80.14   17976905.60 35060 657796473     804117540
64 28 41.77  73.49   75.20   18001910.00 39073 561813658     895289337
70 33 45.51  63.78   64.39   17061897.20 44523 379465571     1020726436
76 36 46.95  57.96   60.32   16964459.60 47717 291299464     1093172384
82 39 47.16  55.43   56.16   16949956.00 49479 247071062     1134163008
88 42 47.41  53.75   47.62   16930911.20 51521 195449924     1180442208
90 43 47.18  51.40   50.59   16864428.00 51618 190758156     1183203901

In the previous test where kswapd was not involved, the system-wide kernel
mode CPU consumption with 90 dd tasks was 16%. In this test CPU consumption
with 90 tasks is at 43%. With 52 cores, and two kswapd tasks (one per NUMA
node), kswapd can only be responsible for a little over 4% of the increase.
The rest is likely caused by 51,618 direct reclaims that scanned 1.2
billion pages over the five minute time period of the test.

Same test, more kswapd tasks:

Test #4: 4 kswapd threads per node
dd sy dd_cpu kswapd0 kswapd1 throughput  dr    pgscan_kswapd pgscan_direct
10 5  27.09  16.65   14.17   7842605.60  0     459105291     0
16 10 37.12  26.02   24.85   11352920.40 15    920527796     358515
22 11 36.94  37.13   35.82   13771869.60 0     1132169011     0
28 13 35.23  48.43   46.86   16089746.00 0     1312902070     0
34 15 33.37  53.02   55.69   18314856.40 0     1476169080     0
40 19 35.90  69.60   64.41   19836126.80 0     1629999149     0
46 22 36.82  88.55   57.20   20740216.40 0     1708478106     0
52 24 34.38  93.76   68.34   21758352.00 0     1794055559     0
58 24 30.51  79.20   82.33   22735594.00 0     1872794397     0
64 26 30.21  97.12   76.73   23302203.60 176   1916593721     4206821
70 33 32.92  92.91   92.87   23776588.00 3575  1817685086     85574159
76 37 31.62  91.20   89.83   24308196.80 4752  1812262569     113981763
82 29 25.53  93.23   92.33   24802791.20 306   2032093122     7350704
88 43 37.12  76.18   77.01   25145694.40 20310 1253204719     487048202
90 42 38.56  73.90   74.57   22516787.60 22774 1193637495     545463615

By increasing the number of kswapd threads, throughput increased by ~50%
while kernel mode CPU utilization decreased or stayed the same, likely due
to a decrease in the number of parallel tasks at any given time doing page
replacement.

Change-Id: I966d4a9c33bad188b3409f7ceea1df205a63c3bd
Signed-off-by: Buddy Lumpkin <buddy.lumpkin@oracle.com>
Patch-mainline: linux-mm @ Mon,  2 Apr 2018 09:24:22
Link: https://lore.kernel.org/lkml/1522661062-39745-1-git-send-email-buddy.lumpkin@oracle.com
[charante@codeaurora.org]: Changes done to ensure QGKI compliance.
Signed-off-by: Charan Teja Kalla <charante@codeaurora.org>
2022-07-18 06:32:42 +00:00
Dark-Matter7232
5babd23106 mm: Import oplus memory management hacks
- Add a separate swappiness (default 60) value to use if task isn't handled by kswapd.
- Don't throttle tasks with OOM value < 0.
- Increase zsmalloc's maximum page order.
[cyberknight777]:
- Reword Kconfig option.
- Import with clean indents.
- Be more descriptive in Kconfig option's description.

Signed-off-by: Dark-Matter7232 <kerneldeveloper7232@gmail.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2022-07-12 08:29:20 +00:00
Michael Bestas
339d7c91c5 Revert "Add toggle for disabling newly added USB devices"
This reverts commit 49e8875d968e934a5cb92654d406da2b4a727bef.

Change-Id: I87caa32a8b6e535682edb8fb2557d8bce718ebf8
2022-04-22 14:39:00 +00:00
Juhyung Park
c810b18857 sched: promote nodes out of CONFIG_SCHED_DEBUG
xNombre: Android modifies some scheduler parameters on boot.
Applying these manually resulted in better hackbench performance.

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
2022-04-18 11:36:03 +00:00
kondors1995
834e38ed40 Revert "sched: separate capacity margin for boosted tasks"
This reverts commit d25218232773159d2a2fe6e9352b193232f86fc3.
2022-04-18 11:35:57 +00:00
Jimmy Shiu
c7ba9a6d72 sched/core: fix userspace affining threads incorrectly by task name.
To identify certain apps which request max cpu freq to affine its
tasks to specific cpus, besides checking its lib name, task name is
also a factor that we can identify the suspcious task.

Test: build and test the 'perfect kick 2' game.
Bug: 163293825
Bug: 161324271
Change-Id: I4359859db743b4c9122e9df40af0b109370e8f1f
Signed-off-by: Jimmy Shiu <jimmyshiu@google.com>
2022-04-18 11:35:55 +00:00
Pavankumar Kondeti
399546962f sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I50d41aa3338803cbd45ff6314b2bb3978c59282b
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2022-04-18 11:35:55 +00:00
Abhijeet Dharmapurikar
b8878d198c sched/core: fix userspace affining threads incorrectly
Certain userspace applications, to achieve max performance, affines its
threads to cpus that run the fastest. This is not always the
correct strategy. For e.g. in certain architectures all the
cores have the same max freq but few of them have a bigger
cache. Affining to the cpus that have bigger cache is advantageous
but such an application would end up affining them to all the cores.
Similarly if an architecture has just one cpu that runs at max freq,
it ends up crowding all its thread on that single core, which is
detrimental for performance.

To address this issue, we need to detect a suspicious looking affinity
request from userspace and check if it links in a particular library.
The latter can easily be detected by traversing executable vm areas
that map a file and checking for that library name.
When such a affinity request is found, change it to use a proper
affinity. The suspicious affinity request, the proper affinity request
and the library name can be configured by the userspace.

Change-Id: I6bb8c310ca54c03261cc721f28dfd6023ab5591a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-04-18 11:35:54 +00:00
Rick Yiu
7993d535b1 sched: separate capacity margin for boosted tasks
With the introduction of placement hint patch, boosted tasks will not
scheduled from big cores. We tune capacity margin to let important
boosted tasks get scheduled on big cores. However, the capacity margin
affects all group of tasks, so that non-boosted tasks get more chances
to be scheduled on big cores, too. This could be solved by separating
capacity margin for boosted tasks.

Bug: 147785606
Test: margin set correctly
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I2b02e138e36a6844afbc1ade60fe86a001814b30
2022-04-18 11:35:53 +00:00
Rick Yiu
d56e68dd3b sched: use sysctl to control energy aware feature
Energy aware feature control is previously done through debugfs,
which will be deprecated, so move the control to sysctl.

Bug: 141333728
Test: function works as expected
Change-Id: I55411d3bb2669ba1fae3225d67cdf1cf8b3b3a7f
Signed-off-by: Rick Yiu <rickyiu@google.com>
2022-04-18 11:35:45 +00:00
Wei Wang
e2a7e442fa Revert "sched/core: fix userspace affining threads incorrectly"
This reverts commit d43b69c4ad.

Bug: 133481659
Test: build
Change-Id: I615023c611c4de1eb334e4374af7306991f4216b
Signed-off-by: Wei Wang <wvw@google.com>
2022-04-18 11:35:44 +00:00
Wei Wang
0c53cbe4b2 Revert "sched: Improve the scheduler"
This reverts commit a3dd94a1bb.

Bug:133481659
Test: build
Change-Id: Ib23609315f3446223521612621fe54469537c172
Signed-off-by: Wei Wang <wvw@google.com>
2022-04-18 11:35:43 +00:00
kondors1995
732ff49539 Revert 4.19 walt backports
Squashed commit of the following:

commit e0da409d20a1120c48f7c7c59a86df2d0e78dff1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:28 2022 +0000

    Revert "Revert "sched/core: Fix migration to invalid CPU in __set_cpus_allowed_ptr()""

    This reverts commit 8cb322ba44.

commit 04e33109bae2cb907809e9e72dc78b4b0e9d90d9
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:27 2022 +0000

    Revert "sched/fair: Derive the downmigration margin wrt the destination CPU"

    This reverts commit 51e64c1746.

commit dc6a3a970d523bc734e97ad0596990a553958bf0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:26 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit b1d4f5bde5.

commit 51e5e01f3aefc05555161d6d1ababc6d6820dd88
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:25 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit e376cd40d2.

commit bb816a5803a37721c54fc9911a8a715b0198713c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:24 2022 +0000

    Revert "sched/fair: Refactor packing eligible test"

    This reverts commit cf6c2a22b4.

commit 1008281e2aacf59465ea31d1176870759f91a774
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:23 2022 +0000

    Revert "sched: improve the scheduler"

    This reverts commit 64813e3d15.

commit 3b75a59b7b65dee631983e5abde1c002f460a521
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:22 2022 +0000

    Revert "sched/fair: Allow prev cpu in find best target"

    This reverts commit 1fe0f64b5a.

commit e197f8cdca5c05f70ba6ada8dd3e2e800bafe0fc
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:21 2022 +0000

    Revert "sched/fair: Fix excessive packing on the max capacity CPU"

    This reverts commit a88cad82cf.

commit 1d908d935c132824ab580f976d9fce751ab502f8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:20 2022 +0000

    Revert "sched/fair: upadte adjust_cpus_for_packing()"

    This reverts commit 08fc238c86.

commit 35dfbb767009eea348be9ac3417b26981abdd084
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:19 2022 +0000

    Revert "sched: clean-up unused/duplicate functions & variables"

    This reverts commit f79c18f23b.

commit 628d78cac047cf164f1cca797b759a43b31696a9
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:17 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit e9fb7c0c28.

commit 0c142a2c77c8e418112613305eb7c87063057890
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:16 2022 +0000

    Revert "sched: walt: Improve the scheduler"

    This reverts commit ad12d47ad6.

commit 2391d0e3d7d4af22524dce0b26d795f882fde0db
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:15 2022 +0000

    Revert "sched: Cleanup unused variables in walt"

    This reverts commit 0e968578ac.

commit e91fd23c44195b9c78a5886cff0cd56990d61137
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:14 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit 863d26df6d.

commit e24b63cc81d5972d0e34a6c37e060cdd64f89771
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:13 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit 994a047706.

commit a34d6a00b583d4a7317a82d92522d5f3bda3298b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:12 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit baa8d4249a.

commit a662ab5cc78cc1cac9a60d2724ae61535cf59b44
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:10 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit e265dccce7.

commit 62d089b4eb705f00a516a2a385c15be3fad2d121
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:09 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit 336a7071de.

commit 099a09326ea2861a907fe1b4100f9ffc919bb81f
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:08 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 44961a76c8.

commit 68a7976e08cb6bff6dff6e4cea50797db7f97d46
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:07 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit b3bb2f6702.

commit ce15f63df0b323f21571e578b78279f5b73ac55a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:06 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 5e8ba22939.

commit da639b7d4ed1640374429b7e84a228aab2594b60
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:05 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 0d154364e0.

commit 6453444f3a69837c4c59d7b3776b1e9a6c83d3b0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:04 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 2d4e6b3850.

commit 60c9ef39c478a270982b4ac74be4cfdd949fcea4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:03 2022 +0000

    Revert "Revert "sched/walt: Fix clusters sorting when cpufreq is disabled""

    This reverts commit ecb2fca5a5.

commit 33af0f5a305d28ab8f987fe3757d125a2bf8f130
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:02 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit f00a64321e.

commit f3fe9acea84ec9559e5b535398cd834f625adafd
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:15:01 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit ca3cf0c1f8.

commit fff2855a694922257cafba5c566d738658410006
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:59 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit c66e488424.

commit 330f224e9601caf2400b15949cccdbb08f8761eb
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:58 2022 +0000

    Revert "sched/fair: Fix incorrect CPU access in check_for_migration()"

    This reverts commit 16dc974f96.

commit eb3f2244ddf02170cc0fccb6aa9c2fc2b6dfd6ca
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:57 2022 +0000

    Revert "sched/isolcpus: Fix "isolcpus=" boot parameter handling when !CONFIG_CPUMASK_OFFSTACK"

    This reverts commit 5ef4e5cef6.

commit b64c764d8daf65dfd447efd89413d6d5f3381751
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:56 2022 +0000

    Revert "sched/walt: drop preferred_cluster from rtg"

    This reverts commit 1ce7c8a179.

commit 457b01d4c8813018619e195955775e6d4ea66c9a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:55 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit bd092bfed6.

commit 47c826dd511e3737e4b53cd9f0472c3f823ecbd3
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:54 2022 +0000

    Revert "sched/core_ctl: Improve the scheduler"

    This reverts commit 8964743af3.

commit f0cf13df89999757c4da2e886c6cdd765ea2e3b6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:53 2022 +0000

    Revert "sched/core_ctl: Improve the scheduler"

    This reverts commit 92e14b075c.

commit 1adc283c65f9515513e5a30cd905b4b8b6809332
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:52 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit 5c94ee0b1a.

commit 1e8a22f9053996f2180bf36e628680989f7f90bb
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:51 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 3ae8342c24.

commit e45b6f52bdc9b22c01eec659861960506724bca7
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:50 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 9990dee761.

commit 033162e61ddfbe1246f67a753ea0e8d43e15fa7a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:49 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit e3bae83cac.

commit 100777f449cab40087d7c7eaffeea6f10c5585f0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:47 2022 +0000

    Revert "arm64/kernel/topology: Cleanup for upstream commit"

    This reverts commit a25719b05f.

commit 0391ca54d164ad24c8376adc70def2e7a5faa6a0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:46 2022 +0000

    Revert "arch_topology: Add possible sibling cpu mask for cpu_topology"

    This reverts commit 3f85bf06fc.

commit 734e104fbb95479ccc65e8328d4593d75f9ddffc
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:45 2022 +0000

    Revert "sched: core: Fix usage of cpu core group mask"

    This reverts commit 2d611d5b65.

commit dc146ddb1e552bfb36bdc8bec88c0b7cd216db55
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:44 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 2c99a96fa9.

commit 81507941532a132c8cb6ec88b2826e5b2395df26
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:43 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 834321e1fa.

commit f9f1c603aafec86a0cae9510b12f6775ca32319a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:42 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit d56300430c.

commit 070be3e6c57af46d64b10d2d7668f6cd8d4fe81c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:41 2022 +0000

    Revert "sched: Introduce sched_busy_hysteresis_enable_cpus tunable"

    This reverts commit 4ec8a76524.

commit da2d5427df5ca95ad10619565f51fa8289eeddb0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:40 2022 +0000

    Revert "sched: Use bitmask for sched_busy_hysteresis_enable_cpus tunable"

    This reverts commit 8ff5bf1a85.

commit af0dd2fa72ae04535e7b2a6ba7344bd4fc261fac
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:38 2022 +0000

    Revert "sched: Remove unused code in sched_avg.c"

    This reverts commit 33d95a041f.

commit 365ccf7a4b2255ac4bc7e55479a9d0baa7de9cf8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:37 2022 +0000

    Revert "lpm-levels: Optimize and make way for upstream changes"

    This reverts commit 6b1e097698.

commit 27379e7c071a3b1b00e53dccd8c9fd7aa720aa19
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:36 2022 +0000

    Revert "cpuidle: lpm-levels: get bias time from scheduler"

    This reverts commit facfee4aad.

commit b08d8d2fca732aa7b69f3c71bff0274cfa3d17cb
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:35 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit cc9cafa54a.

commit 1ce46c9093dcfc81288a2d9927af040bdcf73e14
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:34 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 4543b1af46.

commit 08cfdca5dd69adae0a5d9ece4aa7c91bd1d26199
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:33 2022 +0000

    Revert "sched: walt: Improve the Scheduler"

    This reverts commit e7ea5478b6.

commit deb41564605954c1c933cd8e2b4303e9511d2026
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:32 2022 +0000

    Revert "sched: walt: remove unused variable"

    This reverts commit db642f679e.

commit 9daaaa5c3e5e550973d241360e6cb4ae71eff1f2
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:31 2022 +0000

    Revert "sched: improve the scheduler"

    This reverts commit 0a8cbbef67.

commit 6b92b54daacfdfc35beeddcad64db64933122cf1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:30 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit a8f97c3ca1.

commit fb4945792c7b9986e65a0c67c87158cc0d79ed68
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:28 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 5c0ced5d9d.

commit c3059eedcb167b8497f285886048449dabaa3329
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:27 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit b46bc087bd.

commit e484ee8fe7035dbce43cb177b6672cfeddbd7d56
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:26 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 3366cd2842.

commit 779543197fe683968ce5fcee6f439c62edfdbd9a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:25 2022 +0000

    Revert "sched: walt: Dump walt status on BUG_ON"

    This reverts commit c6983696d2.

commit ac1128af676e0228ffd17c99d858398dd7bc2c12
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:24 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 71925eb668.

commit 5dbef64c7db76e1d41f5afd7c695974cfaac1144
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:23 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 276ff38e69.

commit 4ee3bde67112f36c6773e53be4ec155378a58c57
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:22 2022 +0000

    Revert "sched: walt: fix sched_cluster initialization"

    This reverts commit 616dfe7582.

commit 504de651828c72fac4a1faf310b393a85c73dba4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:21 2022 +0000

    Revert "sched: core: Use sched_clusters for updown migration handler"

    This reverts commit bcf375b081.

commit 8174458135535f1821f4818968d93001377f0276
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:20 2022 +0000

    Revert "sched: walt: Improve the scheduler"

    This reverts commit 26703509e9.

commit 8040981a5cd14d38db10e5dbbd80a14e8008c8a9
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:19 2022 +0000

    Revert "sched/walt: Avoid walt irq work in offlined cpu"

    This reverts commit ca0a0ab303.

commit 74e9893b6c08224fabf46a121e86906965812eb7
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:18 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit 582c417446.

commit d9a19150ca651bc83d3343747b22ccce17bb0b81
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:16 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit a33ebcf1a5.

commit 04cfe69badf318b7e17a21b170366f90bdf43b30
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:15 2022 +0000

    Revert "sched/walt: cleanup unused code"

    This reverts commit e6b442ca5b.

commit 56e3aa3effab63ec2b676085b39dcf67703f468a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:14 2022 +0000

    Revert "sched: walt: improve the scheduler"

    This reverts commit 9ba601ed8e.

commit cb051b1f707e4882aecee1c8dd7eb1ec3b0410f0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:13 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 044275646a.

commit 881007c0098c70dddeab5f95aa3183bbf775603d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:12 2022 +0000

    Revert "sched: walt: Improve the scheduler"

    This reverts commit 57dde83208.

commit 4b2477928d4c47db7fc73234ee1674091e281414
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:11 2022 +0000

    Revert "sched: walt: Improve the scheduler"

    This reverts commit e2d12493b9.

commit 488d2f7d29d551d77baaef3dd6373bb8834c2e6f
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:10 2022 +0000

    Revert "sched/walt: Fix kernel panic issue by uninitialized data"

    This reverts commit 188d0b63d8.

commit 883e23ece4e293f03e4a82af560acf25acf239ab
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:14:08 2022 +0000

    Revert "sched: core_ctl: Improve the scheduler"

    This reverts commit 9b7e0b5f21.

commit 958cb0d96b1d482367fc098d8cc272e87f951778
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:40 2022 +0000

    Revert "sched/fair: Don't place wakee on waker cpu if colocate enabled"

    This reverts commit 8601883f77.

commit d210850cb0ed56404e69d8f1bd861f3d60ea11c7
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:27 2022 +0000

    Revert "sched/cpufreq_schedutil: create a function for common steps"

    This reverts commit 9d8e438e96.

commit c99ccf59736d9ad8c85b671257d51b5d77fc6ae6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:26 2022 +0000

    Revert "cpufreq: schedutil: Queue sugov irq work on policy online cpu"

    This reverts commit f4a7dc5aa1.

commit ec851ca3918470d88c17c28625b31f1f9aaa3817
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:25 2022 +0000

    Revert "cpufreq: Avoid leaving stale IRQ work items during CPU offline"

    This reverts commit 03029dc44f.

commit d369a7c3f411362e7e86838c0c5b245496e5ecf3
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:24 2022 +0000

    Revert "sched: fair: Stop running idle_balance on active migration kick"

    This reverts commit f8fdaaa848.

commit 0933780bb1ef84cf5f7a1beba11128888e67bef8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:23 2022 +0000

    Revert "sched: Improve the scheduler"

    This reverts commit 84ace0489f.

commit f9531a065ca011b87ad8f2f3c6aa4fdf11228f19
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:21 2022 +0000

    Revert "sched: fair: Improve the scheduler"

    This reverts commit a5b78d7ac5.

commit 4e8db29f70d6793d50cd7c88e40f763c6e97b84c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:20 2022 +0000

    Revert "sched/fair: remove unused variable"

    This reverts commit 1dcc8eb8a5.

commit 509b3a23dd53000fdb9734e95aa173d36de0072c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:19 2022 +0000

    Revert "sched/fair: Cleanup for incoming upstream changes"

    This reverts commit 23bda40eae.

commit 5c3a880db3a913d35a679b490a904d82baf0fcb7
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:18 2022 +0000

    Revert "sched/fair: Cleanup for incoming upstream changes"

    This reverts commit 3be3cb8ef9.

commit 3de879456c8e4dd958976f5401458c8a1e7d06bf
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:17 2022 +0000

    Revert "sched/fair: Force gold cpus to do idle lb when silver has big tasks"

    This reverts commit 9a28daeff9.

commit fc407cdd5f935dc09138232eda906be64babe078
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:15 2022 +0000

    Revert "sched/fair: Avoid force newly idle load balance if have iowait task"

    This reverts commit 7ab60698b4.

commit aa2f0e5475d7617825863870cbfe911c94bb349c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:14 2022 +0000

    Revert "sched: Add support to spread tasks"

    This reverts commit 498769889e.

commit dfb558643fcad1eb47eeedd3c3b79526dccf29af
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:13 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 66934ec9de.

commit 5331542fb14397de915e0ee8401f2d4834cfcce5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:12 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 9775bcc63e.

commit 699dab97a2a180453621562c1c25e9374c15942a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:11 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit 0673f890b2.

commit 8dbc5b59fa5b0baae560a7080b45c5785ce17825
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:10 2022 +0000

    Revert "sched/walt: Improve the scheduler"

    This reverts commit f2c76a4b63.

commit 613fc288a80db796b7d366aebbafd036010f918b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:08 2022 +0000

    Revert "sched/fair: Tighten prefer_spread feature"

    This reverts commit 88be255f29.

commit 852249f0a586ed1d1acec2efc653b5dfbc4095a8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:07 2022 +0000

    Revert "sched/fair: Add timeout for detach_tasks() in load balance"

    This reverts commit e4b2c9df2a.

commit 3f4e2e4785b1986d338f3ff8e9f38ef6f9c666bd
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:06 2022 +0000

    Revert "sched/walt: Avoid taking rq lock for every IRQ update"

    This reverts commit b03a5af6b4.

commit a94a2242cb47d1fc216173b69ef1fe15ecc152b4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:13:02 2022 +0000

    Revert "ANDROID: sched: fair: balance for single core cluster"

    This reverts commit b30f8c0381.

commit e3b844e3251e3fcf5b89ca3935e4aaa3c383bff4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Tue Apr 12 07:11:50 2022 +0000

    Revert "rcu/nocb: Perform deferred wake up before last idle's need_resched() check"

    This reverts commit 8a6d3eaab1.
2022-04-18 11:35:12 +00:00
kondors1995
3ebe017e9f Merge branch 'android-4.14-stable' of https://android.googlesource.com/kernel/common into 12.0 2022-03-16 08:01:39 +00:00
Greg Kroah-Hartman
2414f45b93 Merge 4.14.271 into android-4.14-stable
Changes in 4.14.271
	x86/speculation: Merge one test in spectre_v2_user_select_mitigation()
	x86,bugs: Unconditionally allow spectre_v2=retpoline,amd
	x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE
	x86/speculation: Add eIBRS + Retpoline options
	Documentation/hw-vuln: Update spectre doc
	x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting
	x86/speculation: Use generic retpoline by default on AMD
	x86/speculation: Update link to AMD speculation whitepaper
	x86/speculation: Warn about Spectre v2 LFENCE mitigation
	x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT
	arm/arm64: Provide a wrapper for SMCCC 1.1 calls
	arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
	ARM: report Spectre v2 status through sysfs
	ARM: early traps initialisation
	ARM: use LOADADDR() to get load address of sections
	ARM: Spectre-BHB workaround
	ARM: include unprivileged BPF status in Spectre V2 reporting
	ARM: fix build error when BPF_SYSCALL is disabled
	ARM: fix co-processor register typo
	ARM: Do not use NOCROSSREFS directive with ld.lld
	ARM: fix build warning in proc-v7-bugs.c
	xen/xenbus: don't let xenbus_grant_ring() remove grants in error case
	xen/grant-table: add gnttab_try_end_foreign_access()
	xen/blkfront: don't use gnttab_query_foreign_access() for mapped status
	xen/netfront: don't use gnttab_query_foreign_access() for mapped status
	xen/scsifront: don't use gnttab_query_foreign_access() for mapped status
	xen/gntalloc: don't use gnttab_query_foreign_access()
	xen: remove gnttab_query_foreign_access()
	xen/9p: use alloc/free_pages_exact()
	xen/gnttab: fix gnttab_end_foreign_access() without page specified
	xen/netfront: react properly to failing gnttab_end_foreign_access_ref()
	Linux 4.14.271

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9f41bca7a4638913cfd2b97006d19185dd9bf584
2022-03-11 11:13:06 +01:00
Josh Poimboeuf
383973dc1a x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting
commit 44a3918c8245ab10c6c9719dd12e7a8d291980d8 upstream.

With unprivileged eBPF enabled, eIBRS (without retpoline) is vulnerable
to Spectre v2 BHB-based attacks.

When both are enabled, print a warning message and report it in the
'spectre_v2' sysfs vulnerabilities file.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
[fllinden@amazon.com: backported to 4.14]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:28 +01:00
kondors1995
25fb184df0 Merge branch 'android-4.14-stable' of https://android.googlesource.com/kernel/common into 12.0 2022-02-19 22:38:41 +00:00
Greg Kroah-Hartman
409d37b568 Merge 4.14.267 into android-4.14-stable
Changes in 4.14.267
	integrity: check the return value of audit_log_start()
	ima: Remove ima_policy file before directory
	ima: Allow template selection with ima_template[_fmt]= after ima_hash=
	mmc: sdhci-of-esdhc: Check for error num after setting mask
	net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
	NFS: Fix initialisation of nfs_client cl_flags field
	NFSD: Clamp WRITE offsets
	NFSv4 only print the label when its queried
	nfs: nfs4clinet: check the return value of kstrdup()
	NFSv4.1: Fix uninitialised variable in devicenotify
	NFSv4 remove zero number of fs_locations entries error check
	NFSv4 expose nfs_parse_server_name function
	scsi: target: iscsi: Make sure the np under each tpg is unique
	usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend
	net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout()
	Revert "net: axienet: Wait for PhyRstCmplt after core reset"
	bpf: Add kconfig knob for disabling unpriv bpf by default
	ARM: dts: imx23-evk: Remove MX23_PAD_SSP1_DETECT from hog group
	ARM: dts: meson: Fix the UART compatible strings
	staging: fbtft: Fix error path in fbtft_driver_module_init()
	ARM: dts: imx6qdl-udoo: Properly describe the SD card detect
	usb: f_fs: Fix use-after-free for epfile
	bonding: pair enable_port with slave_arr_updates
	ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path
	net: do not keep the dst cache when uncloning an skb dst and its metadata
	net: fix a memleak when uncloning an skb dst and its metadata
	tipc: rate limit warning for received illegal binding update
	net: amd-xgbe: disable interrupts during pci removal
	vt_ioctl: fix array_index_nospec in vt_setactivate
	vt_ioctl: add array_index_nospec to VT_ACTIVATE
	n_tty: wake up poll(POLLRDNORM) on receiving data
	usb: ulpi: Move of_node_put to ulpi_dev_release
	usb: ulpi: Call of_node_put correctly
	usb: dwc3: gadget: Prevent core from processing stale TRBs
	USB: gadget: validate interface OS descriptor requests
	usb: gadget: rndis: check size of RNDIS_MSG_SET command
	USB: serial: ftdi_sio: add support for Brainboxes US-159/235/320
	USB: serial: option: add ZTE MF286D modem
	USB: serial: ch341: add support for GW Instek USB2.0-Serial devices
	USB: serial: cp210x: add NCR Retail IO box id
	USB: serial: cp210x: add CPI Bulk Coin Recycler id
	seccomp: Invalidate seccomp mode to catch death failures
	hwmon: (dell-smm) Speed up setting of fan speed
	perf: Fix list corruption in perf_cgroup_switch()
	Linux 4.14.267

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie562265e833202e361fd0734d18731990c0b1cbc
2022-02-16 13:10:03 +01:00
Daniel Borkmann
e69f08ba23 bpf: Add kconfig knob for disabling unpriv bpf by default
commit 08389d888287c3823f80b0216766b71e17f0aba5 upstream.

Add a kconfig knob which allows for unprivileged bpf to be disabled by default.
If set, the knob sets /proc/sys/kernel/unprivileged_bpf_disabled to value of 2.

This still allows a transition of 2 -> {0,1} through an admin. Similarly,
this also still keeps 1 -> {1} behavior intact, so that once set to permanently
disabled, it cannot be undone aside from a reboot.

We've also added extra2 with max of 2 for the procfs handler, so that an admin
still has a chance to toggle between 0 <-> 2.

Either way, as an additional alternative, applications can make use of CAP_BPF
that we added a while ago.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.1620765074.git.daniel@iogearbox.net
[fllinden@amazon.com: backported to 4.14]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-16 12:44:50 +01:00
kondors1995
c496614add Revert "sched: walt: hardcode 4.19 backport values"
This reverts commit 7cf488a0e0.
2022-02-09 18:59:47 +00:00
nato6613
7cf488a0e0 sched: walt: hardcode 4.19 backport values
THis is done since Anykernel fails to do ramdisk changes
2022-01-25 07:41:13 +00:00
kondors1995
6161569975 sysctl: fix -Wunused-variable warning 2021-04-12 09:34:15 +00:00
Lingutla Chandrasekhar
498769889e sched: Add support to spread tasks
If sysctl_sched_prefer_spread is enabled, then tasks would be freely
migrated to idle cpus within same cluster to reduce runnables.

By default, the feature is disabled.
User can trigger feature with:
   echo 1 > /proc/sys/kernel/sched_prefer_spread
	Aggressively spread tasks with in little cluster.
   echo 2 > /proc/sys/kernel/sched_prefer_spread
	Aggressively spread tasks with in little cluster as well as
	big cluster, but not between big and little.

Change-Id: I0a4d87bd17de3525548765472e6f388a9970f13c
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
[render: minor fixups]
Signed-off-by: Zachariah Kennedy <zkennedy87@gmail.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2021-04-12 07:13:38 +00:00
Lingutla Chandrasekhar
044275646a sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I5fbadf248c0bfe27bc761686de7a925cec2e4163
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2021-04-12 07:13:38 +00:00
Sai Harshini Nimmala
a33ebcf1a5 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I33e9ec890f8b54d673770d5d02dba489a8e08ce7
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2021-04-12 07:13:38 +00:00
Lingutla Chandrasekhar
582c417446 sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Ia5367b1220e1a7ec07d6a3fc4fdb18ed5748f490
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2021-04-12 07:13:38 +00:00
Lingutla Chandrasekhar
bcf375b081 sched: core: Use sched_clusters for updown migration handler
Currently, sched updown migration handler derives cluster topology
based on arch topology, the cluster information is already populated
in walt sched_cluster. So reuse it instead of deriving it again.

And move updown tunables support to under WALT.

Change-Id: Iddf4d18ddf75cc20637281d9889f671f42369513
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
[render: minor fixup]
Signed-off-by: Zachariah Kennedy <zkennedy87@gmail.com>
2021-04-12 07:13:38 +00:00
Sai Harshini Nimmala
5c0ced5d9d sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I8459bcf7b412a5f301566054c28c910567548485
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2021-04-12 07:13:38 +00:00
Shaleen Agrawal
e7ea5478b6 sched: walt: Improve the Scheduler
This change is for general scheduler improvement.

Change-Id: Ida39a3ee5e6b4b0d3255bfef95601890afd80709
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-04-12 07:13:38 +00:00
Amir Vajid
4543b1af46 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I8ff4768d56d8e63b2cfa78e5f34cb156ee60e3da
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2021-04-12 07:13:38 +00:00
Amir Vajid
cc9cafa54a sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I737751f065df6a5ed3093e3bda5e48750a14e4c9
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2021-04-12 07:13:38 +00:00