Home

tasklets

Tasklets are a lightweight mechanism in the Linux kernel for deferring work from interrupt context to a later point without creating a full kernel thread. They are a form of bottom-half handling, allowing interrupt handlers to perform short, deferred processing while keeping interrupt latency low.

A tasklet consists of a function to execute and a data pointer, packaged in a per-CPU tasklet

Tasklets are one of several bottom-half mechanisms in the Linux kernel, alongside softirqs and workqueues. They

History and evolution: Tasklets appeared as a simple way to defer work in the kernel and are

structure.
When
code
schedules
a
tasklet
using
tasklet_schedule,
the
tasklet
is
enqueued
on
the
local
CPU’s
tasklet
list.
The
kernel
processes
non-empty
tasklet
lists
during
softirq
handling,
so
tasklets
run
in
softirq
context
on
the
originating
CPU.
They
cannot
sleep
and
typically
run
to
completion
before
control
returns
to
user
code.
If
a
tasklet
is
needed
on
another
CPU,
it
must
be
scheduled
on
that
CPU
as
well.
offer
low-overhead
deferral
suitable
for
short,
non-blocking
tasks
such
as
quick
data
processing
or
signaling
work
for
later
stages.
However,
due
to
their
restrictions—especially
the
inability
to
sleep
and
per-CPU
execution—longer
or
potentially
blocking
work
is
better
handled
by
workqueues
or
threaded
interrupt
handlers.
still
present
for
compatibility,
but
modern
Linux
kernel
development
often
favors
workqueues
for
deferrable
work
that
may
sleep
or
require
more
complex
synchronization.
Tasklets
thus
remain
a
historical
reference
point
for
bottom-half
design
in
the
kernel,
illustrating
the
spectrum
of
interrupt
handling
strategies.
See
also
bottom
halves,
softirq,
and
workqueue.