Revision tags: release/13.0.0 |
|
#
0c56925b |
| 27-Nov-2020 |
Mark Johnston <markj@FreeBSD.org> |
callout(9): Remove some leftover APM BIOS support
This code is obsolete since r366546.
Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27267
|
#
a33fef5e |
| 19-Nov-2020 |
Mark Johnston <markj@FreeBSD.org> |
callout(9): Fix a race between CPU migration and callout_drain()
Suppose a running callout re-arms itself, and before the callout finishes running another CPU calls callout_drain() and goes to sleep
callout(9): Fix a race between CPU migration and callout_drain()
Suppose a running callout re-arms itself, and before the callout finishes running another CPU calls callout_drain() and goes to sleep. softclock_call_cc() will wake up the draining thread, which may not run immediately if there is a lot of CPU load. Furthermore, the callout is still in the callout wheel so it can continue to run and re-arm itself. Then, suppose that the callout migrates to another CPU before the draining thread gets a chance to run. The draining thread is in this loop in _callout_stop_safe():
while (cc_exec_curr(cc) == c) { CC_UNLOCK(cc); sleep(); CC_LOCK(cc); }
but after the migration, cc points to the wrong CPU's callout state. Then the draining thread goes off and removes the callout from the wheel, but does so using the wrong lock and per-CPU callout state.
Fix the problem by doing a re-lookup of the callout CPU after sleeping.
Reported by: syzbot+79569cd4d76636b2cc1c@syzkaller.appspotmail.com Reported by: syzbot+1b27e0237aa22d8adffa@syzkaller.appspotmail.com Reported by: syzbot+e21aa5b85a9aff90ef3e@syzkaller.appspotmail.com Reviewed by: emaste, hselasky Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27266
show more ...
|
#
a28c28e6 |
| 19-Nov-2020 |
Mark Johnston <markj@FreeBSD.org> |
Remove NO_EVENTTIMERS support
The arm configs that required it have been removed from the tree. Removing this option makes the callout code easier to read and discourages developers from adding new
Remove NO_EVENTTIMERS support
The arm configs that required it have been removed from the tree. Removing this option makes the callout code easier to read and discourages developers from adding new configs without eventtimer drivers.
Reviewed by: ian, imp, mav Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27270
show more ...
|
Revision tags: release/12.2.0 |
|
#
624677fa |
| 02-Sep-2020 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Assert that cc_exec_drain(cc, direct) is NULL before assigning a new value.
Suggested by: markj@ Tested by: callout_test MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
|
#
0d0053d7 |
| 02-Sep-2020 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Micro optimise _callout_stop_safe() by removing dead code.
The CS_DRAIN flag cannot be set at the same time like the async-drain function pointer is set. These are orthogonal features. Assert this a
Micro optimise _callout_stop_safe() by removing dead code.
The CS_DRAIN flag cannot be set at the same time like the async-drain function pointer is set. These are orthogonal features. Assert this at the beginning of the function.
Before: if (flags & CS_DRAIN) { /* FALLTHROUGH */ } else if (xxx) { return yyy; } if (drain) { zzz = drain; } After: if (flags & CS_DRAIN) { /* FALLTHROUGH */ } else if (xxx) { return yyy; } else { if (drain) { zzz = drain; } }
Reviewed by: markj@ Tested by: callout_test Differential Revision: https://reviews.freebsd.org/D26285 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
show more ...
|
#
6fed89b1 |
| 02-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
kern: clean up empty lines in .c and .h files
|
Revision tags: release/11.4.0 |
|
#
a99c3218 |
| 16-Mar-2020 |
Conrad Meyer <cem@FreeBSD.org> |
Remove misleading / redundant bzero in callout_callwheel_init
The intent seems to be zeroing all of the cc_cpu array, or its singleton on such platforms. The assumption made is that the BSP is alwa
Remove misleading / redundant bzero in callout_callwheel_init
The intent seems to be zeroing all of the cc_cpu array, or its singleton on such platforms. The assumption made is that the BSP is always zero. The code smell was introduced in r326218, which changed the prior explicit zero to 'curcpu'. The change is only valid if curcpu continues to be zero, contrary to the aim expressed in that commit message.
So, more succinctly, the expression could be: memset(cc_cpu,0,sizeof(cc_cpu)).
However, there's no point. cc_cpu lives in the data section and has a zero initial value already. So this revision just removes the problematic statement.
No functional change. Appeases a (false positive, ish) Coverity CID.
CID: 1383567 Reported by: Puneeth Jothaiah <puneethkumar.jothaia AT dell.com> Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24089
show more ...
|
#
4b28d96e |
| 13-Dec-2019 |
John Baldwin <jhb@FreeBSD.org> |
Remove the deprecated timeout(9) interface.
All in-tree consumers have been converted to callout(9).
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22602
|
#
a8a03706 |
| 10-Dec-2019 |
John Baldwin <jhb@FreeBSD.org> |
Add a callout_func_t typedef for functions used with callout_*().
This typedef is the same as timeout_t except that it is in the callout namespace and header.
Use this typedef in various places of
Add a callout_func_t typedef for functions used with callout_*().
This typedef is the same as timeout_t except that it is in the callout namespace and header.
Use this typedef in various places of the callout implementation that were either using the raw type or timeout_t.
While here, add <sys/callout.h> to the manpage.
Reviewed by: kib, imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22751
show more ...
|
#
61322a0a |
| 04-Dec-2019 |
Alexander Motin <mav@FreeBSD.org> |
Mark some more hot global variables with __read_mostly.
MFC after: 1 week
|
#
329377f4 |
| 22-Nov-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
cc_ktr_event_name is used only with KTR
|
Revision tags: release/12.1.0 |
|
#
f05b9584 |
| 21-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r352537 through r352586.
|
#
36d151a2 |
| 21-Sep-2019 |
Alexander Motin <mav@FreeBSD.org> |
Allocate callout wheel from the respective memory domain.
MFC after: 1 week
|
#
a63915c2 |
| 28-Jul-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @r350386
Sponsored by: The FreeBSD Foundation
|
Revision tags: release/11.3.0 |
|
#
8c5a9161 |
| 03-Jul-2019 |
Eric van Gyzen <vangyzen@FreeBSD.org> |
Save the last callout function executed on each CPU
Save the last callout function pointer (and its argument) executed on each CPU for inspection by a debugger. Add a ddb `show callout_last` comman
Save the last callout function executed on each CPU
Save the last callout function pointer (and its argument) executed on each CPU for inspection by a debugger. Add a ddb `show callout_last` command to show these pointers. Add a kernel module that I used for testing that command.
Relocate `ce_migration_cpu` to reduce padding and therefore preserve the size of `struct callout_cpu` (320 bytes on amd64) despite the added members.
This should help diagnose reference-after-free bugs where the callout's mutex has already been freed when `softclock_call_cc` tries to unlock it.
You might hope that the pointer would still be available, but it isn't. The argument to that function is on the stack (because `softclock_call_cc` uses it later), and that might be enough in some cases, but even then, it's very laborious. A pointer to the callout is saved right before these newly added fields, but that callout might have been freed. We still have the pointer to its associated mutex, and the name within might be enough, but it might also have been freed.
Reviewed by: markj jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20794
show more ...
|
Revision tags: release/12.0.0, release/11.2.0 |
|
#
efe67753 |
| 26-Nov-2017 |
Nathan Whitehorn <nwhitehorn@FreeBSD.org> |
Remove some, but not all, assumptions that the BSP is CPU 0 and that CPUs are numbered densely from there to n_cpus.
MFC after: 1 month
|
#
82725ba9 |
| 23-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325999 through r326131.
|
#
51369649 |
| 20-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for
sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point.
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
ea1e967c |
| 19-May-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r318380 through r318559.
|
#
3e85b721 |
| 17-May-2017 |
Ed Maste <emaste@FreeBSD.org> |
Remove register keyword from sys/ and ANSIfy prototypes
A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for
Remove register keyword from sys/ and ANSIfy prototypes
A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for any compiler used in the FreeBSD world today.
ANSIfy related prototypes while here.
Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10193
show more ...
|
#
7d88be4c |
| 15-Mar-2017 |
Mark Johnston <markj@FreeBSD.org> |
When draining a callout, don't clear CALLOUT_ACTIVE while it is running.
The callout may reschedule itself and execute again before callout_drain() returns, but we should not clear CALLOUT_ACTIVE un
When draining a callout, don't clear CALLOUT_ACTIVE while it is running.
The callout may reschedule itself and execute again before callout_drain() returns, but we should not clear CALLOUT_ACTIVE until the callout is stopped.
Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon
show more ...
|
#
9f3aabb9 |
| 25-Nov-2016 |
John Baldwin <jhb@FreeBSD.org> |
Permit timed sleeps for threads other than thread0 before timers are working.
The callout subsystem already handles early callouts and schedules the first clock interrupt appropriately based on the
Permit timed sleeps for threads other than thread0 before timers are working.
The callout subsystem already handles early callouts and schedules the first clock interrupt appropriately based on the currently pending callouts. The one nit to fix was that callouts scheduled via C_HARDCLOCK during early boot could fire too early once timers were enabled as the per-CPU base time is always zero until timers are initialized. The change in callout_when() handles this case by using the current uptime as the base time of the callout during bootup if the per-CPU base time is zero.
Reviewed by: kib MFC after: 2 weeks Sponsored by: Netflix
show more ...
|
Revision tags: release/11.0.1, release/11.0.0 |
|
#
93badfa1 |
| 16-Sep-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r305687 through r305890.
|
#
69a28758 |
| 15-Sep-2016 |
Ed Maste <emaste@FreeBSD.org> |
Renumber license clauses in sys/kern to avoid skipping #3
|
#
ed04e0c3 |
| 25-Aug-2016 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead @ r304815
|