Commit bf42df0
printk: kunit: support offstack cpumask
For large values of CONFIG_NR_CPUS, the newly added kunit test fails
to build:
kernel/printk/printk_ringbuffer_kunit_test.c: In function 'test_readerwriter':
kernel/printk/printk_ringbuffer_kunit_test.c:279:1: error: the frame size of 1432 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]
Change this to use cpumask_var_t and allocate it dynamically when
CONFIG_CPUMASK_OFFSTACK is set.
The variable has to be released via a KUnit action wrapper so that it is
freed when the test fails and gets aborted. The parameter type is hardcoded
to "struct cpumask *" because the macro KUNIT_DEFINE_ACTION_WRAPPER()
does not accept an array. But the function does nothing when
CONFIG_CPUMASK_OFFSTACK is not set anyway.
Fixes: 5ea2bcd ("printk: ringbuffer: Add KUnit test")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/all/20250620192554.2234184-1-arnd@kernel.org # v1
[pmladek@suse.com: Correctly handle allocation failures and freeing using KUnit test API.]
Link: https://lore.kernel.org/all/20250702095157.110916-3-pmladek@suse.com # v2
Signed-off-by: Petr Mladek <pmladek@suse.com>1 parent d18d798 commit bf42df0
1 file changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
228 | 237 | | |
229 | 238 | | |
230 | 239 | | |
| |||
247 | 256 | | |
248 | 257 | | |
249 | 258 | | |
250 | | - | |
| 259 | + | |
251 | 260 | | |
252 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
253 | 265 | | |
254 | 266 | | |
255 | 267 | | |
256 | 268 | | |
257 | 269 | | |
258 | 270 | | |
259 | 271 | | |
260 | | - | |
| 272 | + | |
261 | 273 | | |
262 | 274 | | |
263 | 275 | | |
264 | | - | |
265 | | - | |
| 276 | + | |
| 277 | + | |
266 | 278 | | |
267 | 279 | | |
268 | | - | |
| 280 | + | |
269 | 281 | | |
270 | 282 | | |
271 | 283 | | |
| |||
278 | 290 | | |
279 | 291 | | |
280 | 292 | | |
281 | | - | |
| 293 | + | |
282 | 294 | | |
283 | 295 | | |
284 | 296 | | |
| |||
0 commit comments