STRUCT PADATA_MT_JOB(9)
π struct padata_mt_job(9) β Kernel API Manual, but make it make sense
okay bestie, so this is the manual page for struct padata_mt_job(9) and it lives in the Kernel API Manual, and honestly? it's giving "one multithreaded job, but make it a whole personality." let's get into it π«Ά
β¨ NAME β¨
struct padata_mt_job β literally represents one multithreaded job. that's it, that's the whole vibe. one job. many threads. iconic.
πΈ SYNOPSIS πΈ
here's the struct in all its glory, copy-pasted exactly because we do not freestyle kernel code, ever:
struct padata_mt_job {
void (*thread_fn)(unsigned long start, unsigned long end, void
*arg);
void *fn_arg;
unsigned long start;
unsigned long size;
unsigned long align;
unsigned long min_chunk;
int max_threads;
bool numa_aware;
};
no cap, that's the exact layout. don't touch it. π
π¦ MEMBERS π¦
okay so every field, and what it actually does, let's go one by one π₯
thread_fnβ this is the callback. it gets called for each chunk of work that a padata thread does. so yeah, this is where the actual labour happens, main character energy fr fr.fn_argβ the thread function argument. it's just the thing you hand tothread_fn. the little messenger bag of data. πstartβ the start of the job. and bestie, note the caveat: units are job-specific. that means the numbers mean whatever your job says they mean, don't @ me. πsizeβ size of this node's work. again, units are job-specific, so don't assume it's bytes. it's whatever your job deals in. πalignβ ranges passed to the thread function fall on this boundary, with the possible exceptions of the beginning and end of the job. so like, mostly aligned, but the edges get a pass. noted, respect the exception. β¨min_chunkβ the minimum chunk size, in job-specific units. this is how the client communicates the minimum amount of work that's appropriate for one worker thread to do at once. so it's the "don't bother spinning up a thread for less than this" number. lowkey important. πmax_threadsβ max threads to use for the job. and here's the fine print: the actual number may be less depending on task size and minimum chunk size. so it's a ceiling, not a promise. πnuma_awareβ distribute jobs to different nodes with CPU in a round robin fashion. round robin, babe. taking turns like civilized nodes. π
π SEE ALSO π
if you're going down the rabbit hole (and you are, i can tell), go look at the kernel file ./include/linux/padata.h and its besties:
struct padata_priv(9)struct padata_list(9)struct padata_serial_queue(9)struct padata_cpumask(9)struct parallel_data(9)struct padata_shell(9)struct padata_instance(9)
that's the whole squad. iykyk π§
reminder bestie: every number here is in job-specific units, and max_threads is a max, not a guarantee. don't come for me when you get fewer threads than you asked for β the manpage warned you π
and that's a wrap, mwah π this one came from the source at ./include/linux, dated October 2026, and it's filed under struct padata_mt_job(9) in case you need to find it again. slay, go read your kernel headers, periodt. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms