OpenBSD CVS

CVS log for src/sys/sys/task.h


[BACK] Up to [local] / src / sys / sys

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.18 / (download) - annotate - [select for diffs], Sat Aug 1 08:40:20 2020 UTC (3 years, 10 months ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, HEAD
Changes since 1.17: +4 -1 lines
Diff to previous 1.17 (colored)

Add support for remote coverage to kcov. Remote coverage is collected
from threads other than the one currently having kcov enabled. A thread
with kcov enabled occasionally delegates work to another thread,
collecting coverage from such threads improves the ability of syzkaller
to correlate side effects in the kernel caused by issuing a syscall.

Remote coverage is divided into subsystems. The only supported subsystem
right now collects coverage from scheduled tasks and timeouts on behalf
of a kcov enabled thread. In order to make this work `struct task' and
`struct timeout' must be extended with a new field keeping track of the
process that scheduled the task/timeout. Both aforementioned structures
have therefore increased with the size of a pointer on all
architectures.

The kernel API is documented in a new kcov_remote_register(9) manual.

Remote coverage is also supported by kcov on NetBSD and Linux.

ok mpi@

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jun 8 00:27:45 2020 UTC (4 years ago) by dlg
Branch: MAIN
Changes since 1.16: +1 -2 lines
Diff to previous 1.16 (colored)

visa points out we don't use or need the TASK_BARRIER flag anymore.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jun 23 12:56:10 2019 UTC (4 years, 11 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored)

Make taskq_barrier(9) work for multi-threaded task queues.

ok visa@

Revision 1.15 / (download) - annotate - [select for diffs], Sun Apr 28 04:20:40 2019 UTC (5 years, 1 month ago) by dlg
Branch: MAIN
Changes since 1.14: +3 -1 lines
Diff to previous 1.14 (colored)

add WITNESS support to barriers modelled on the timeout stuff visa did.

if a taskq takes a lock, and something holding that lock calls
taskq_barrier, there's a potential deadlock. detect this as a lock
order problem when witness is enable. task_del conditionally followed
by taskq_barrier is a common pattern, so add a taskq_del_barrier
wrapper for it that unconditionally checks for the deadlock, like
timeout_del_barrier.

ok visa@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Apr 1 03:23:45 2019 UTC (5 years, 2 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.13: +1 -2 lines
Diff to previous 1.13 (colored)

deprecate TASKQ_CANTSLEEP since nothing uses it anymore

if we ever want it back, it's in the attic.

ok mpi@ visa@ kettenis@

Revision 1.13 / (download) - annotate - [select for diffs], Sun Dec 16 03:36:02 2018 UTC (5 years, 5 months ago) by dlg
Branch: MAIN
Changes since 1.12: +5 -1 lines
Diff to previous 1.12 (colored)

add task_pending

jsg@ wants this for drm, and i've had a version of it in diffs sine
2016, but obviously havent needed to use it just yet.

task_pending is modelled on timeout_pending, and tells you if the
task is on a list waiting to execute.

ok jsg@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Nov 13 23:52:49 2017 UTC (6 years, 6 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.11: +2 -1 lines
Diff to previous 1.11 (colored)

add taskq_barrier

taskq_barrier guarantees that any task that was running on the taskq
has finished by the time taskq_barrier returns. it is similar to
intr_barrier.

this is needed for use in ifq_barrier as part of an upcoming change.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jun 7 07:53:33 2016 UTC (8 years ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.10: +3 -4 lines
Diff to previous 1.10 (colored)

Move initialization macro outside of #define _KERNEL to use them in
ART regression tests.

ok dlg@, jmatthew@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Dec 8 11:55:47 2015 UTC (8 years, 6 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

_SYS_TASKQ_H_ -> _SYS_TASK_H_

Revision 1.9 / (download) - annotate - [select for diffs], Tue Dec 8 11:40:37 2015 UTC (8 years, 6 months ago) by dlg
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

+TAILQ_HEAD(task_list, task);

Revision 1.8 / (download) - annotate - [select for diffs], Mon Feb 9 03:15:41 2015 UTC (9 years, 4 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.7: +5 -2 lines
Diff to previous 1.7 (colored)

we want to defer work traditionally (in openbsd) handled in an
interrupt context to a taskq running in a thread. however, there
is a concern that if we do that then we allow accidental use of
sleeping APIs in this work, which will make it harder to move the
work back to interrupts in the future.

guenther and kettenis came up with the idea of marking a proc with
CANTSLEEP which the sleep paths can check and panic on.

this builds on that so you create taskqs that run with CANTSLEEP
set except when they need to sleep for more tasks to run.

the taskq_create api is changed to take a flags argument so users
can specify CANTSLEEP. MPSAFE is also passed via this flags field
now.  this means archs that defined IPL_MPSAFE to 0 can now create
mpsafe taskqs too.

lots of discussion at s2k15
ok guenther@ miod@ mpi@ tedu@ pelikan@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jan 27 03:17:37 2015 UTC (9 years, 4 months ago) by dlg
Branch: MAIN
Changes since 1.6: +6 -8 lines
Diff to previous 1.6 (colored)

remove the second void * argument on tasks.

when workqs were introduced, we provided a second argument so you
could pass a thing and some context to work on it in. there were
very few things that took advantage of the second argument, so when
i introduced pools i suggested removing it. since tasks were meant
to replace workqs, it was requested that we keep the second argument
to make porting from workqs to tasks easier.

now that workqs are gone, i had a look at the use of the second
argument again and found only one good use of it (vdsp(4) on sparc64
if you're interested) and a tiny handful of questionable uses. the
vast majority of tasks only used a single argument. i have since
modified all tasks that used two args to only use one, so now we
can remove the second argument.

so this is a mechanical change. all tasks only passed NULL as their
second argument, so we can just remove it.

ok krw@

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jun 11 08:47:53 2014 UTC (10 years ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

Create system taskq ("systqmp") which runs without the kernel lock;
currently unused.

ok dlg@
manpage improvement and ok jmc@

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 23 04:20:47 2013 UTC (10 years, 5 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.4: +5 -1 lines
Diff to previous 1.4 (colored)

provide a TASK_INITIALIZER() macro.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Oct 31 04:33:32 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored)

hide kernel protytypes
ok dlg

Revision 1.3 / (download) - annotate - [select for diffs], Wed Oct 30 02:11:32 2013 UTC (10 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored)

deprecate taskq_systq() and replace it with extern struct taskq
*const systq defined in task.h

this reduces the cost of using the system taskq and looks less ugly.

requested by and ok kettenis@

Revision 1.2 / (download) - annotate - [select for diffs], Tue Oct 29 04:32:08 2013 UTC (10 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

use unsigned int instead of u_int to reduce the depend on types.h.

might make jsg a little happier.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Oct 29 04:23:16 2013 UTC (10 years, 7 months ago) by dlg
Branch: MAIN

introduce tasks and taskqs as an alternative to workqs.

tasks are modelled on the timeout api, so users familiar with
timeout_set, timeout_add, and timeout_del will already know what
to expect from task_set, task_add, and task_del.

i wrote this because workq_add_task can fail in the place you
actually need it, and there arent any good ways of recovering at
that point.  workq_queue_task was added to try and help, but required
external state to be stored for users of that api to know whether
something was already queued or not.

workqs also didnt provide a way to cancel or remove work.

this has been percolating with a bunch of people. putting it in as i
wrote it so i can apply their feedback to the code with the history kept
in cvs.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.