24 Commits

Author SHA1 Message Date
Sultan Alsawaf
a7cd3decd1 sched/completion: Expose wait_for_common*() to drivers
Allow drivers to wait with a custom task state specified by exposing the
raw wait_for_common*() functions. This allows code to wait for completions
that are invariant with respect to CPU performance *without* contributing
to load avg, without requiring the wait to be interruptible.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-04-21 22:19:50 +03:00
kondors1995
af30df53ee treeweide: Revert Pixel 8 cass backports
Someting caused issues with media playback

Squashed commit of the following:

commit 9b42dfb148a86d279550e50e7374c799a03a5a6f
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:41 2024 +0300

    Revert "sched/fair: Clean up calc_cfs_shares()"

    This reverts commit 09f624912f.

commit 8acb165e9e42219646fd3e6d6c3f51a6f702a686
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:32 2024 +0300

    Revert "sched/fair: Add comment to calc_cfs_shares()"

    This reverts commit f9d3ffd696.

commit 423c42eb6eb17ad7f3f33cdab7fdf1ff0f98dc79
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:32 2024 +0300

    Revert "sched/fair: Cure calc_cfs_shares() vs. reweight_entity()"

    This reverts commit 82b9ddd10d.

commit 1093143c06279c2d89b3241ac3e5abf339f7abcd
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:31 2024 +0300

    Revert "sched/fair: Remove se->load.weight from se->avg.load_sum"

    This reverts commit 8afedeb608.

commit 4504e6b8c2119e092e831879cbd9c6adaea2713a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:31 2024 +0300

    Revert "sched: remove rt_rq utilization tracking for now"

    This reverts commit ca1bdfe9c2.

commit db5377a1b2868ffc6d3f33225353c33398e1de7b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:30 2024 +0300

    Revert "sched/fair: Change update_load_avg() arguments"

    This reverts commit 561a960285.

commit d099da1d8854cbbdb8fca1c4eaf4f692f940a6c7
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:30 2024 +0300

    Revert "sched/fair: Move enqueue migrate handling"

    This reverts commit 4fe3a618af.

commit 9b8f11264e1bd21ecfd69b6c77e88d9893e20a98
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:29 2024 +0300

    Revert "sched/fair: Rename {en,de}queue_entity_load_avg()"

    This reverts commit 86597c5bf2.

commit 382d23f36c9c5430b0f96cbf379ded416bc1f330
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:29 2024 +0300

    Revert "sched/fair: Introduce {en,de}queue_load_avg()"

    This reverts commit 04ee68d87c.

commit 7d7c60a4d4ceb493f40703bf596ac949df31dd33
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:28 2024 +0300

    Revert "sched/fair: More accurate reweight_entity()"

    This reverts commit ec54bd1f93.

commit afcd60d3ee87de1d4f069acc713e2097d9b40be8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:28 2024 +0300

    Revert "sched/fair: Use reweight_entity() for set_user_nice()"

    This reverts commit 0d5a173dfd.

commit af78e8c698df9201648634d7dd1e4804494a765d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:27 2024 +0300

    Revert "sched/fair: Rewrite cfs_rq->removed_*avg"

    This reverts commit 7b0d11dc5a.

commit 2a44c05e1f96b14f80ea578b386af04eb24e5aac
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:27 2024 +0300

    Revert "sched/fair: Rewrite PELT migration propagation"

    This reverts commit dc3a4b3e44.

commit a876ca5f4b2937b8adc90b3f502376d45a891d54
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:26 2024 +0300

    Revert "sched/fair: Propagate an effective runnable_load_avg"

    This reverts commit 017d4c0519.

commit 8a0c9809f3fbabc583a485af142b40f0b9945a6d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:26 2024 +0300

    Revert "sched/fair: Implement synchonous PELT detach on load-balance migrate"

    This reverts commit c240cbcefb.

commit 8d002da6ccedb08096a371826525e0e21587f469
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Align PELT windows between cfs_rq and its se"

    This reverts commit 2b669872a6.

commit ceb6db696fe8210e0dc9ce1643fcea314ae84d68
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Implement more accurate async detach"

    This reverts commit a5dce93362.

commit d6afb5da3f6ccc3c426ec6cef2c4b955b0127f79
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Calculate runnable_weight slightly differently"

    This reverts commit 49af7a9c70.

commit 302db79364ce3cdd41e9b33f48a0d5a8c9818ded
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:24 2024 +0300

    Revert "sched/fair: Update calc_group_*() comments"

    This reverts commit 245ba7cfcb.

commit 61ec8d04a966c839f3f204e99e5006a1e42c816a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:23 2024 +0300

    Revert "sched/pelt: Move PELT related code in a dedicated file"

    This reverts commit 05c4270dbb.

commit 494151c770c9afcf2f4231029bb35d337385c5f8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:23 2024 +0300

    Revert "sched/rt: Add rt_rq utilization tracking"

    This reverts commit 1efbd97f33.

commit ee00f39c0c36fc5c7d17b9fc8f7a273acd537efe
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:22 2024 +0300

    Revert "sched: fix build"

    This reverts commit bead5679af.

commit c85ab7e00b755f7b0b008d0657ecc805755248e1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:22 2024 +0300

    Revert "sched/dl: Add dl_rq utilization tracking"

    This reverts commit 1f48d4df0e.

commit d99ffef9a8069efde7bb85869280025b60519db6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:21 2024 +0300

    Revert "sched/irq: Add IRQ utilization tracking"

    This reverts commit d1c9480337.

commit 2be20e582bf3129e9b572f6b39cef311d0fe3d15
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:20 2024 +0300

    Revert "sched/schedutil: add `schedutil_freq_util()`"

    This reverts commit f3e8cb0f44.

commit b495ca0e67d581fc7cc7d250d26d36fdeb8181c4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:20 2024 +0300

    Revert "FROMLIST: sched: Relocate arch_scale_cpu_capacity"

    This reverts commit 844d670403.

commit 33c4a0dc0cfb20c02cdb705770f888343d11a1a0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:19 2024 +0300

    Revert "sched: cpufreq: add map_util_freq()"

    This reverts commit 1f9df50075.

commit d2fedfac7610b0121e6338a8c64ac7414b5b5965
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:19 2024 +0300

    Revert "sched/pelt: Add support to track thermal pressure"

    This reverts commit 17e0388043.

commit afe91b6a918674b387deeb5ec201a3b7fd720c48
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:18 2024 +0300

    Revert "sched/topology: Add callback to read per CPU thermal pressure"

    This reverts commit 69693e21cc.

commit 760f1b0c528c1d2d8fe62be335d98caa74671f51
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:17 2024 +0300

    Revert "drivers/base/arch_topology: Add infrastructure to store and update instantaneous thermal pressure"

    This reverts commit 25a4c1f1a7.

commit 38dc404537a51df485fc1001a440d66f9e5bdfe3
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:17 2024 +0300

    Revert "arm64/topology: Populate arch_scale_thermal_pressure() for arm64 platforms"

    This reverts commit 27a4d5d4ed.

commit 9c1479b093688b09dcf386f019b34203c6dc1367
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:16 2024 +0300

    Revert "arm/topology: Populate arch_scale_thermal_pressure() for ARM platforms"

    This reverts commit 97e866391b.

commit 67039c6e35777ef753590f15f07190b9296a309c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:16 2024 +0300

    Revert "sched/fair: Enable periodic update of average thermal pressure"

    This reverts commit 7ab5e58f6e.

commit 2a53cfee36bed22116d35da58ea944d5448910d8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:15 2024 +0300

    Revert "BACKPORT: thermal: cpu_cooling: Update thermal pressure in case of a maximum frequency capping"

    This reverts commit 7d4b5af102.

commit 618bb2f007c30c047bd72ec4764f4da321041382
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:14 2024 +0300

    Revert "UPSTREAM: thermal: cpu_cooling: Update also offline CPUs per-cpu thermal_pressure"

    This reverts commit ee683c1595.

commit 57938e1686bc19a3455355bde6df5b339db46b1b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:14 2024 +0300

    Revert "sched/fair: Enable tuning of decay period"

    This reverts commit a00583df62.

commit a06182dc6401475c7eb31aed0965d13ebc6881d1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:13 2024 +0300

    Revert "init: Enable SCHED_THERMAL_PRESSURE by default"

    This reverts commit dcf24600af.

commit 9e5796f48feeb87d2dd5966d4bdffa2c78fd559d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:12 2024 +0300

    Revert "sched:schedutil: Reland at @65b6f06b6a"

    This reverts commit f1a3787c1f.

commit 5a99475c6807fbd3f6a4b88fe18ef9853de5dbb8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:12 2024 +0300

    Revert "thermal: cpu_cooling: fix backport"

    This reverts commit 84c18edb67.

commit 78ecfc16e24ee2da5b6f39a30c67d1134c60ee55
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:11 2024 +0300

    Revert "thermal/cpu-cooling, sched/core: Move the arch_set_thermal_pressure() API to generic scheduler code"

    This reverts commit b5c0f9489d.

commit 7df5eb08365aad663f6aff85e47dd87e986b4bd6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:10 2024 +0300

    Revert "sched/cass: Fix CPU selection when no candidate CPUs are idle"

    This reverts commit 545493ec2d.

commit ee830b6597ce40cc38dee0486ba5b6628eee86a5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:10 2024 +0300

    Revert "sched/cass: Clean up local variable scope in cass_best_cpu()"

    This reverts commit 03bd4ff101.

commit 298863d627468afad930e3483f8f594af047f149
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:09 2024 +0300

    Revert "sched/cass:checkout to kerneltoast/android_kernel_google_zuma@63f0b82d3"

    This reverts commit 5d04a85007.

commit 5caf8ee3242cc9e531093620e9d0edf34d2d9bd5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:09 2024 +0300

    Revert "sched/cass: Perform runqueue selection for RT tasks too"

    This reverts commit 9752c4351d.

commit 99b278beedd77cf50fd59af702712b84dfdb6358
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:08 2024 +0300

    Revert "sched/cass: Fix suboptimal task placement when uclamp is used"

    This reverts commit e6b365c5b5.

commit 3b36702eb33d772c3730bdba422c84b2750d0d8e
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:07 2024 +0300

    Revert "sched/cass: Only treat sync waker CPU as idle if there's one task running"

    This reverts commit d12d7eee39.

commit 3037abe8c3c25cfc906ad34ea4155874167835cc
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:07 2024 +0300

    Revert "sched/cass: Eliminate redundant calls to smp_processor_id()"

    This reverts commit f686c22d10.

commit 8bef770149584f5336390367ce20ac8e0991e523
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:06 2024 +0300

    Revert "sched/cass:Adapt for our sources"

    This reverts commit 15e0e548dd.

commit cf47e4130be6df5b4581451dcf712c14ef545044
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:05 2024 +0300

    Revert "sched/fair: Set migration cost to zero to leverage DynamIQ Shared Unit"

    This reverts commit 553243db2f.

commit 9a02852fc864ea71b5d426b5b7aceeba8c72281c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:05 2024 +0300

    Revert "sbalance: Allow IRQs to be moved off of excluded CPUs"

    This reverts commit cba4cee059.

commit 072fd97abf76bca1587d5a6a183125d8c2667c49
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:04 2024 +0300

    Revert "sbalance: Use a deferrable timer to avoid waking idle CPUs"

    This reverts commit 9efd9574cd.

commit d788e1caba4bf5bc5d3a81d2a96cfbd4d3b51381
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:03 2024 +0300

    Revert "sbalance: Use non-atomic cpumask_clear_cpu() variant"

    This reverts commit 11502f0b2b.

commit be608ef254b24bc0f5a807676bc2aa37a75c0c41
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:03 2024 +0300

    Revert "sbalance: Fix systemic issues caused by flawed IRQ statistics"

    This reverts commit dca8268454.

commit d99703fa29615b4a9f5b051742cd2f64ad65ef53
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:02 2024 +0300

    Revert "cpufreq: schedutil: Use the frequency below the target if they're close"

    This reverts commit 9a7a26c904.

commit 1cf28ec326ca586bd9b5a555e777c0ce49a9371c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:02 2024 +0300

    Revert "raphael_defconfig: Reduce IRQ_SBALANCE_POLL_MSEC to default 3000"

    This reverts commit ab033d4dca.

commit 53ce1242f7c643c525b239c464ba61cfcef3f5ea
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:01 2024 +0300

    Revert "Revert "cpufreq: schedutil: Use the frequency below the target if they're close""

    This reverts commit 217db388c4.

commit 63f8122b844e194bc197c2a17a11871651017af6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:00 2024 +0300

    Revert "Revert "cpufreq: schedutil: Extend limit tunables to prime""

    This reverts commit 056441ef45.

commit 09c2c5be085b6c10a6ab974b84404badc85ff393
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:00 2024 +0300

    Revert "Revert "cpufreq: schedutil: Expose limit tunables cluster-wise""

    This reverts commit d4c03145b6.

commit f3473acea98f745b142608e182b163c08110affe
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:59 2024 +0300

    Revert "raphael_defconfig:Exclude core 3 from IRQ balancing"

    This reverts commit 1b7085aae6.

commit b7ce57d5f7480430cb9e530a3a7206f2dd6456e5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:58 2024 +0300

    Revert "cpufreq: schedutil: Use the frequency below the target if they're close"

    This reverts commit b64b535bea.

commit c99a62857fd75daafe6a6a76fdfe20242fb59d9d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:57 2024 +0300

    Revert "cpufreq: schedutil: Set default up/down rate limits to 500/1000 us"

    This reverts commit 2dff5ad0ff.

commit f505c93a25bc5d741b52e2e219ddd86fd9022976
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:57 2024 +0300

    Revert "cpufreq: schedutil: Protect default up/down rate limits"

    This reverts commit d0164cdf9a.

commit b5b279845790b0b072e3abf3886d5430434d30f4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:56 2024 +0300

    Revert "drm: Convert CPU-invariant uninterruptible waits to TASK_IDLE"

    This reverts commit a252ff2d01.

commit 9575adb91c2880a5dbeff1fec93aac44295f939a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:55 2024 +0300

    Revert "pm_qos: Use SRCU notifier chains"

    This reverts commit 29d5065905.

commit 644abfbbd422a8f6aa9902839cfee155b3496c24
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:55 2024 +0300

    Revert "sched/completion: Expose wait_for_common*() to drivers"

    This reverts commit 483d30a710.

commit 1fc08c6cd803c0c24421d5d992ea4b16357aeb92
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:51 2024 +0300

    Revert "treewide: Fix warnings"

    This reverts commit abfb9659df.
2024-04-21 22:19:43 +03:00
Sultan Alsawaf
483d30a710 sched/completion: Expose wait_for_common*() to drivers
Allow drivers to wait with a custom task state specified by exposing the
raw wait_for_common*() functions. This allows code to wait for completions
that are invariant with respect to CPU performance *without* contributing
to load avg, without requiring the wait to be interruptible.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-04-06 13:01:50 +03:00
Thomas Gleixner
63f45bd4ef completion: Use simple wait queues
Completions have no long lasting callbacks and therefor do not need
the complex waitqueue variant. Use simple waitqueues which reduces the
contention on the waitqueue lock.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2022-05-09 07:32:00 +00:00
Greg Kroah-Hartman
b24413180f License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:10:55 +01:00
Boqun Feng
ec81048cc3 sched/completion: Avoid unnecessary stack allocation for COMPLETION_INITIALIZER_ONSTACK()
In theory, COMPLETION_INITIALIZER_ONSTACK() should never affect the
stack allocation of the caller. However, on some compilers, a temporary
structure was allocated for the return value of
COMPLETION_INITIALIZER_ONSTACK().

For example in write_journal() with LOCKDEP_COMPLETIONS=y (GCC is 7.1.1):

	io_comp.comp = COMPLETION_INITIALIZER_ONSTACK(io_comp.comp);
	    2462:       e8 00 00 00 00          callq  2467 <write_journal+0x47>
	    2467:       48 8d 85 80 fd ff ff    lea    -0x280(%rbp),%rax
	    246e:       48 c7 c6 00 00 00 00    mov    $0x0,%rsi
	    2475:       48 c7 c2 00 00 00 00    mov    $0x0,%rdx
		x->done = 0;
	    247c:       c7 85 90 fd ff ff 00    movl   $0x0,-0x270(%rbp)
	    2483:       00 00 00
		init_waitqueue_head(&x->wait);
	    2486:       48 8d 78 18             lea    0x18(%rax),%rdi
	    248a:       e8 00 00 00 00          callq  248f <write_journal+0x6f>
		if (commit_start + commit_sections <= ic->journal_sections) {
	    248f:       41 8b 87 a8 00 00 00    mov    0xa8(%r15),%eax
		io_comp.comp = COMPLETION_INITIALIZER_ONSTACK(io_comp.comp);
	    2496:       48 8d bd e8 f9 ff ff    lea    -0x618(%rbp),%rdi
	    249d:       48 8d b5 90 fd ff ff    lea    -0x270(%rbp),%rsi
	    24a4:       b9 17 00 00 00          mov    $0x17,%ecx
	    24a9:       f3 48 a5                rep movsq %ds:(%rsi),%es:(%rdi)
		if (commit_start + commit_sections <= ic->journal_sections) {
	    24ac:       41 39 c6                cmp    %eax,%r14d
		io_comp.comp = COMPLETION_INITIALIZER_ONSTACK(io_comp.comp);
	    24af:       48 8d bd 90 fd ff ff    lea    -0x270(%rbp),%rdi
	    24b6:       48 8d b5 e8 f9 ff ff    lea    -0x618(%rbp),%rsi
	    24bd:       b9 17 00 00 00          mov    $0x17,%ecx
	    24c2:       f3 48 a5                rep movsq %ds:(%rsi),%es:(%rdi)

We can obviously see the temporary structure allocated, and the compiler
also does two meaningless memcpy with "rep movsq".

And according to:

	https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement-Exprs

The return value of a statement expression is returned by value, so the
temporary variable is created in COMPLETION_INITIALIZER_ONSTACK(), and
that's why the temporary structures are allocted.

To fix this, make the brace block in COMPLETION_INITIALIZER_ONSTACK()
return a pointer and dereference it outside the block rather than return
the whole structure, in this way, we are able to teach the compiler not
to do the unnecessary stack allocation.

This could also reduce the stack size even if !LOCKDEP, for example in
write_journal(), compiled with gcc 7.1.1, the result of command:

	 objdump -d drivers/md/dm-integrity.o | ./scripts/checkstack.pl x86

before:

	0x0000246a write_journal [dm-integrity.o]:              696

after:

	0x00002b7a write_journal [dm-integrity.o]:              296

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: walken@google.com
Cc: willy@infradead.org
Link: http://lkml.kernel.org/r/20170823152542.5150-3-boqun.feng@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-29 15:14:38 +02:00
Byungchul Park
ea3f2c0fdf locking/lockdep: Rename CONFIG_LOCKDEP_COMPLETE to CONFIG_LOCKDEP_COMPLETIONS
'complete' is an adjective and LOCKDEP_COMPLETE sounds like 'lockdep is complete',
so pick a better name that uses a noun.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/1502960261-16206-3-git-send-email-byungchul.park@lge.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-17 11:38:55 +02:00
Byungchul Park
cd8084f91c locking/lockdep: Apply crossrelease to completions
Although wait_for_completion() and its family can cause deadlock, the
lock correctness validator could not be applied to them until now,
because things like complete() are usually called in a different context
from the waiting context, which violates lockdep's assumption.

Thanks to CONFIG_LOCKDEP_CROSSRELEASE, we can now apply the lockdep
detector to those completion operations. Applied it.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: akpm@linux-foundation.org
Cc: boqun.feng@gmail.com
Cc: kernel-team@lge.com
Cc: kirill@shutemov.name
Cc: npiggin@gmail.com
Cc: walken@google.com
Cc: willy@infradead.org
Link: http://lkml.kernel.org/r/1502089981-21272-10-git-send-email-byungchul.park@lge.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-10 12:29:10 +02:00
Wolfram Sang
62026aedaa sched: remove INIT_COMPLETION
All users are converted over to reinit_completion(). Remove the old
macro now.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-15 09:32:21 +09:00
Wolfram Sang
c32f74ab28 sched: replace INIT_COMPLETION with reinit_completion
For the casual device driver writer, it is hard to remember when to use
init_completion (to init a completion structure) or INIT_COMPLETION (to
*reinit* a completion structure).  Furthermore, while all other
completion functions exepct a pointer as a parameter, INIT_COMPLETION
does not.  To make it easier to remember which function to use and to
make code more readable, introduce a new inline function with the proper
name and consistent argument type.  Update the kernel-doc for
init_completion while we are here.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-15 09:32:21 +09:00
Peter Zijlstra
b8a216269e sched: Move completion code from core.c to completion.c
Completions already have their own header file: linux/completion.h
Move the implementation out of kernel/sched/core.c and into its own
file: kernel/sched/completion.c.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-x2y49rmxu5dljt66ai2lcfuw@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-11-06 07:49:19 +01:00
Viresh Kumar
0a0fca9d83 sched: Rename sched.c as sched/core.c in comments and Documentation
Most of the stuff from kernel/sched.c was moved to kernel/sched/core.c long time
back and the comments/Documentation never got updated.

I figured it out when I was going through sched-domains.txt and so thought of
fixing it globally.

I haven't crossed check if the stuff that is referenced in sched/core.c by all
these files is still present and hasn't changed as that wasn't the motive behind
this patch.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/cdff76a265326ab8d71922a1db5be599f20aad45.1370329560.git.viresh.kumar@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-06-19 12:58:42 +02:00
Vladimir Davydov
686855f5d8 sched: add wait_for_completion_io[_timeout]
The only difference between wait_for_completion[_timeout]() and
wait_for_completion_io[_timeout]() is that the latter calls
io_schedule_timeout() instead of schedule_timeout() so that the caller
is accounted as waiting for IO, not just sleeping.

These functions can be used for correct iowait time accounting when the
completion struct is actually used for waiting for IO (e.g. completion
of a bio request in the block layer).

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2013-02-15 16:45:06 +01:00
NeilBrown
6bf4123760 sched: Change wait_for_completion_*_timeout() to return a signed long
wait_for_completion_*_timeout() can return:

   0: if the wait timed out
 -ve: if the wait was interrupted
 +ve: if the completion was completed.

As they currently return an 'unsigned long', the last two cases
are not easily distinguished which can easily result in buggy
code, as is the case for the recently added
wait_for_completion_interruptible_timeout() call in
net/sunrpc/cache.c

So change them both to return 'long'.  As MAX_SCHEDULE_TIMEOUT
is LONG_MAX, a large +ve return value should never overflow.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: J.  Bruce Fields <bfields@fieldses.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20110105125016.64ccab0e@notabene.brown>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-01-05 14:15:50 +01:00
Randy Dunlap
ee2f154a59 docbook: add more wait/wake/completion to device-drivers docbook
Add more wait, wake, and completion interfaces to the device-drivers
docbook.

Fix kernel-doc notation in the added files.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26 17:32:41 -07:00
Sage Weil
0aa12fb439 sched: add wait_for_completion_killable_timeout
Add missing _killable_timeout variant for wait_for_completion that will
return when a timeout expires or the task is killed.

CC: Ingo Molnar <mingo@elte.hu>
CC: Andreas Herrmann <andreas.herrmann3@amd.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Sage Weil <sage@newdream.net>
2010-05-29 09:12:30 -07:00
Kevin Diggs
65eb3dc609 sched: add kernel doc for the completion, fix kernel-doc-nano-HOWTO.txt
This patch adds kernel doc for the completion feature.

An error in the split-man.pl PERL snippet in kernel-doc-nano-HOWTO.txt is
also fixed.

Signed-off-by: Kevin Diggs <kevdig@hypersurf.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-08-26 10:26:54 +02:00
Dave Chinner
be4de35263 completions: uninline try_wait_for_completion and completion_done
m68k fails to build with these functions inlined in completion.h.  Move
them out of line into sched.c and export them to avoid this problem.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-15 08:35:44 -07:00
David Chinner
39d2f1ab2a [XFS] extend completions to provide XFS object flush requirements
XFS object flushing doesn't quite match existing completion semantics.  It
mixed exclusive access with completion.  That is, we need to mark an object as
being flushed before flushing it to disk, and then block any other attempt to
flush it until the completion occurs.  We do this but adding an extra count to
the completion before we start using them.  However, we still need to
determine if there is a completion in progress, and allow no-blocking attempts
fo completions to decrement the count.

To do this we introduce:

int try_wait_for_completion(struct completion *x)
	returns a failure status if done == 0, otherwise decrements done
	to zero and returns a "started" status. This is provided
	to allow counted completions to begin safely while holding
	object locks in inverted order.

int completion_done(struct completion *x)
	returns 1 if there is no waiter, 0 if there is a waiter
	(i.e. a completion in progress).

This replaces the use of semaphores for providing this exclusion
and completion mechanism.

SGI-PV: 981498

SGI-Modid: xfs-linux-melb:xfs-kern:31816a

Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
2008-08-13 16:40:43 +10:00
Matthew Wilcox
009e577e07 Add wait_for_completion_killable
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2007-12-06 17:40:19 -05:00
Ingo Molnar
b15136e949 sched: fix fastcall mismatch in completion APIs
Jeff Dike noticed that wait_for_completion_interruptible()'s prototype
had a mismatched fastcall.

Fix this by removing the fastcall attributes from all the completion APIs.

Found-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2007-10-24 18:23:48 +02:00
Ingo Molnar
f86bf9b7bc [PATCH] lockdep: clean up completion initializer in smpboot.c
Clean up lockdep on-stack-completion initializer.  (This also removes the
dependency on waitqueue_lock_key.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:14 -07:00
Ingo Molnar
8b3db9c542 [PATCH] lockdep: add DECLARE_COMPLETION_ONSTACK() API
lockdep needs to have the waitqueue lock initialized for on-stack waitqueues
implicitly initialized by DECLARE_COMPLETION().  Introduce the API.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-03 15:27:00 -07:00
Linus Torvalds
1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00