Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

types: move struct rcuwait into types.h

Move rcuwait struct definition into types.h so that rcuwait can be used
without including rcuwait.h which includes other headers. Without this
change mm_types.h can't use rcuwait due to a the following circular
dependency:

mm_types.h -> rcuwait.h -> signal.h -> mm_types.h

Link: https://lkml.kernel.org/r/20250213224655.1680278-7-surenb@google.com
Suggested-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Davidlohr Bueso <dave@stgolabs.net>
Acked-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Tested-by: Shivank Garg <shivankg@amd.com>
Link: https://lkml.kernel.org/r/5e19ec93-8307-47c2-bb13-3ddf7150624e@amd.com
Cc: Christian Brauner <brauner@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Klara Modin <klarasmodin@gmail.com>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Minchan Kim <minchan@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: "Paul E . McKenney" <paulmck@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Sourav Panda <souravpanda@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Suren Baghdasaryan and committed by
Andrew Morton
2c2bd11c fe605930

+13 -12
+1 -12
include/linux/rcuwait.h
··· 4 4 5 5 #include <linux/rcupdate.h> 6 6 #include <linux/sched/signal.h> 7 - 8 - /* 9 - * rcuwait provides a way of blocking and waking up a single 10 - * task in an rcu-safe manner. 11 - * 12 - * The only time @task is non-nil is when a user is blocked (or 13 - * checking if it needs to) on a condition, and reset as soon as we 14 - * know that the condition has succeeded and are awoken. 15 - */ 16 - struct rcuwait { 17 - struct task_struct __rcu *task; 18 - }; 7 + #include <linux/types.h> 19 8 20 9 #define __RCUWAIT_INITIALIZER(name) \ 21 10 { .task = NULL, }
+12
include/linux/types.h
··· 248 248 typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv); 249 249 typedef int (*cmp_func_t)(const void *a, const void *b); 250 250 251 + /* 252 + * rcuwait provides a way of blocking and waking up a single 253 + * task in an rcu-safe manner. 254 + * 255 + * The only time @task is non-nil is when a user is blocked (or 256 + * checking if it needs to) on a condition, and reset as soon as we 257 + * know that the condition has succeeded and are awoken. 258 + */ 259 + struct rcuwait { 260 + struct task_struct __rcu *task; 261 + }; 262 + 251 263 #endif /* __ASSEMBLY__ */ 252 264 #endif /* _LINUX_TYPES_H */