Thread (30 messages) 30 messages, 8 authors, 2021-06-18

[PATCH 0/6] sched: Cleanup task_struct::state

flat view
STALE1963d

From: Peter Zijlstra <peterz@infradead.org>
Date: 2021-06-02 13:31:34
Also in: cgroups, dm-devel, kvm, linux-block, linux-fsdevel, linux-mm, linux-pm, linux-usb, lkml, netdev, rcu
Subsystem: block layer, control group (cgroup), device-mapper (lvm), exec & binfmt api, elf, filesystems (vfs and infrastructure), freezer, high-resolution timers, timer wheel, clockevents, hung task detector, kernel virtual machine (kvm), kgdb / kdb /debug_core, library code, locking primitives, memory management, memory management - core, memory management - page allocator, networking drivers, networking [general], performance events subsystem, ptrace support, qualcomm atheros qca7k ethernet driver, read-copy update (rcu), scheduler, the rest, torture-test modules, usb gadget/peripheral subsystem, usb subsystem, x86 architecture (32-bit and 64-bit) · Maintainers: Jens Axboe, Tejun Heo, Johannes Weiner, Michal Koutný, Alasdair Kergon, Mike Snitzer, Mikulas Patocka, Benjamin Marzinski, Kees Cook, Alexander Viro, Christian Brauner, "Rafael J. Wysocki", Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner, Andrew Morton, Lance Yang, Paolo Bonzini, Jason Wessel, Daniel Thompson, Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, David Hildenbrand, Vlastimil Babka, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arnaldo Carvalho de Melo, Namhyung Kim, Oleg Nesterov, Stefan Wahren, "Paul E. McKenney", Neeraj Upadhyay, Joel Fernandes, Josh Triplett, Uladzislau Rezki, Juri Lelli, Vincent Guittot, Linus Torvalds, Davidlohr Bueso, Neill Kapron, Greg Kroah-Hartman, Borislav Petkov, Dave Hansen

Hi!

The task_struct::state variable is a bit odd in a number of ways:

 - it's declared 'volatile' (against current practises);
 - it's 'unsigned long' which is a weird size;
 - it's type is inconsistent when used for function arguments.

These patches clean that up by making it consistently 'unsigned int', and
replace (almost) all accesses with READ_ONCE()/WRITE_ONCE(). In order to not
miss any, the variable is renamed, ensuring a missed conversion results in a
compile error.

The first few patches fix a number of pre-existing errors and introduce a few
helpers to make the final conversion less painful.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help