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

Configure Feed

Select the types of activity you want to include in your feed.

smp: Add missing kernel-doc comments

Add missing kernel-doc comments and rearrange the order of others to
prevent all kernel-doc warnings.

- add function Returns: sections or format existing comments as kernel-doc
- add missing function parameter comments
- use "/**" for smp_call_function_any() and on_each_cpu_cond_mask()
- correct the commented function name for on_each_cpu_cond_mask()
- use correct format for function short descriptions
- add all kernel-doc comments for smp_call_on_cpu()
- remove kernel-doc comments for raw_smp_processor_id() since there is
no prototype for it here (other than !SMP)
- in smp.h, rearrange some lines so that the kernel-doc comments for
smp_processor_id() are immediately before the macro (to prevent
kernel-doc warnings)
- remove "Returns" from smp_call_function() since it doesn't
return a value

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260310061726.1153764-1-rdunlap@infradead.org

authored by

Randy Dunlap and committed by
Thomas Gleixner
cc562394 c3692998

+48 -32
+23 -19
include/linux/smp.h
··· 73 73 } 74 74 75 75 /** 76 - * on_each_cpu_mask(): Run a function on processors specified by 76 + * on_each_cpu_mask() - Run a function on processors specified by 77 77 * cpumask, which may include the local processor. 78 78 * @mask: The set of cpus to run on (only runs on online subset). 79 79 * @func: The function to run. This must be fast and non-blocking. ··· 239 239 240 240 #endif /* !SMP */ 241 241 242 - /** 242 + /* 243 243 * raw_smp_processor_id() - get the current (unstable) CPU id 244 244 * 245 - * For then you know what you are doing and need an unstable 245 + * raw_smp_processor_id() is arch-specific/arch-defined and 246 + * may be a macro or a static inline function. 247 + * 248 + * For when you know what you are doing and need an unstable 246 249 * CPU id. 247 - */ 248 - 249 - /** 250 - * smp_processor_id() - get the current (stable) CPU id 251 - * 252 - * This is the normal accessor to the CPU id and should be used 253 - * whenever possible. 254 - * 255 - * The CPU id is stable when: 256 - * 257 - * - IRQs are disabled; 258 - * - preemption is disabled; 259 - * - the task is CPU affine. 260 - * 261 - * When CONFIG_DEBUG_PREEMPT; we verify these assumption and WARN 262 - * when smp_processor_id() is used when the CPU id is not stable. 263 250 */ 264 251 265 252 /* ··· 261 274 #ifdef CONFIG_DEBUG_PREEMPT 262 275 extern unsigned int debug_smp_processor_id(void); 263 276 # define smp_processor_id() debug_smp_processor_id() 277 + 264 278 #else 279 + /** 280 + * smp_processor_id() - get the current (stable) CPU id 281 + * 282 + * This is the normal accessor to the CPU id and should be used 283 + * whenever possible. 284 + * 285 + * The CPU id is stable when: 286 + * 287 + * - IRQs are disabled; 288 + * - preemption is disabled; 289 + * - the task is CPU affine. 290 + * 291 + * When CONFIG_DEBUG_PREEMPT=y, we verify these assumptions and WARN 292 + * when smp_processor_id() is used when the CPU id is not stable. 293 + */ 294 + 265 295 # define smp_processor_id() __smp_processor_id() 266 296 #endif 267 297
+25 -13
kernel/smp.c
··· 215 215 /** 216 216 * csd_lock_is_stuck - Has a CSD-lock acquisition been stuck too long? 217 217 * 218 - * Returns @true if a CSD-lock acquisition is stuck and has been stuck 218 + * Returns: @true if a CSD-lock acquisition is stuck and has been stuck 219 219 * long enough for a "non-responsive CSD lock" message to be printed. 220 220 */ 221 221 bool csd_lock_is_stuck(void) ··· 625 625 local_irq_restore(flags); 626 626 } 627 627 628 - /* 628 + /** 629 629 * smp_call_function_single - Run a function on a specific CPU 630 + * @cpu: Specific target CPU for this function. 630 631 * @func: The function to run. This must be fast and non-blocking. 631 632 * @info: An arbitrary pointer to pass to the function. 632 633 * @wait: If true, wait until function has completed on other CPUs. 633 634 * 634 - * Returns 0 on success, else a negative status code. 635 + * Returns: %0 on success, else a negative status code. 635 636 */ 636 637 int smp_call_function_single(int cpu, smp_call_func_t func, void *info, 637 638 int wait) ··· 739 738 } 740 739 EXPORT_SYMBOL_GPL(smp_call_function_single_async); 741 740 742 - /* 741 + /** 743 742 * smp_call_function_any - Run a function on any of the given cpus 744 743 * @mask: The mask of cpus it can run on. 745 744 * @func: The function to run. This must be fast and non-blocking. 746 745 * @info: An arbitrary pointer to pass to the function. 747 746 * @wait: If true, wait until function has completed. 748 747 * 749 - * Returns 0 on success, else a negative status code (if no cpus were online). 750 - * 751 748 * Selection preference: 752 749 * 1) current cpu if in @mask 753 750 * 2) nearest cpu in @mask, based on NUMA topology 751 + * 752 + * Returns: %0 on success, else a negative status code (if no cpus were online). 754 753 */ 755 754 int smp_call_function_any(const struct cpumask *mask, 756 755 smp_call_func_t func, void *info, int wait) ··· 881 880 } 882 881 883 882 /** 884 - * smp_call_function_many(): Run a function on a set of CPUs. 883 + * smp_call_function_many() - Run a function on a set of CPUs. 885 884 * @mask: The set of cpus to run on (only runs on online subset). 886 885 * @func: The function to run. This must be fast and non-blocking. 887 886 * @info: An arbitrary pointer to pass to the function. ··· 903 902 EXPORT_SYMBOL(smp_call_function_many); 904 903 905 904 /** 906 - * smp_call_function(): Run a function on all other CPUs. 905 + * smp_call_function() - Run a function on all other CPUs. 907 906 * @func: The function to run. This must be fast and non-blocking. 908 907 * @info: An arbitrary pointer to pass to the function. 909 908 * @wait: If true, wait (atomically) until function has completed 910 909 * on other CPUs. 911 - * 912 - * Returns 0. 913 910 * 914 911 * If @wait is true, then returns once @func has returned; otherwise 915 912 * it returns just before the target cpu calls @func. ··· 1008 1009 smp_cpus_done(setup_max_cpus); 1009 1010 } 1010 1011 1011 - /* 1012 - * on_each_cpu_cond(): Call a function on each processor for which 1012 + /** 1013 + * on_each_cpu_cond_mask() - Call a function on each processor for which 1013 1014 * the supplied function cond_func returns true, optionally waiting 1014 1015 * for all the required CPUs to finish. This may include the local 1015 1016 * processor. ··· 1023 1024 * @info: An arbitrary pointer to pass to both functions. 1024 1025 * @wait: If true, wait (atomically) until function has 1025 1026 * completed on other CPUs. 1027 + * @mask: The set of cpus to run on (only runs on online subset). 1026 1028 * 1027 1029 * Preemption is disabled to protect against CPUs going offline but not online. 1028 1030 * CPUs going online during the call will not be seen or sent an IPI. ··· 1095 1095 * scheduled, for any of the CPUs in the @mask. It does not guarantee 1096 1096 * correctness as it only provides a racy snapshot. 1097 1097 * 1098 - * Returns true if there is a pending IPI scheduled and false otherwise. 1098 + * Returns: true if there is a pending IPI scheduled and false otherwise. 1099 1099 */ 1100 1100 bool cpus_peek_for_pending_ipi(const struct cpumask *mask) 1101 1101 { ··· 1145 1145 complete(&sscs->done); 1146 1146 } 1147 1147 1148 + /** 1149 + * smp_call_on_cpu() - Call a function on a specific CPU and wait 1150 + * for it to return. 1151 + * @cpu: The CPU to run on. 1152 + * @func: The function to run 1153 + * @par: An arbitrary pointer parameter for @func. 1154 + * @phys: If @true, force to run on physical @cpu. See 1155 + * &struct smp_call_on_cpu_struct for more info. 1156 + * 1157 + * Returns: %-ENXIO if the @cpu is invalid; otherwise the return value 1158 + * from @func. 1159 + */ 1148 1160 int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys) 1149 1161 { 1150 1162 struct smp_call_on_cpu_struct sscs = {