tree: git://git.cmpxchg.org/linux-mmotm.git master head: 6d150629f934eb5e894b5eb3a56ba47328f56798 commit: 1b560efe80bfe6a5862b8219fd9294694d2aed10 [126/128] mutex subsystem, synchro-test module config: x86_64-allmodconfig (attached as .config) compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce: git checkout 1b560efe80bfe6a5862b8219fd9294694d2aed10 # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): kernel/synchro-test.c: In function 'do_tests': >> kernel/synchro-test.c:512:2: error: implicit declaration of function 'init_timer'; did you mean 'init_timers'? [-Werror=implicit-function-declaration] init_timer(&timer); ^~~~~~~~~~ init_timers >> kernel/synchro-test.c:513:17: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] timer.function = stop_test; ^ cc1: some warnings being treated as errors vim +512 kernel/synchro-test.c 429 430 /*****************************************************************************/ 431 /* 432 * 433 */ 434 static int __init do_tests(void) 435 { 436 unsigned long loop; 437 unsigned int spinlock_total, mutex_total, sem_total; 438 unsigned int rd_total, wr_total, dg_total; 439 440 if (numsp < 0 || numsp > MAX_THREADS || 441 nummx < 0 || nummx > MAX_THREADS || 442 numsm < 0 || numsm > MAX_THREADS || 443 numrd < 0 || numrd > MAX_THREADS || 444 numwr < 0 || numwr > MAX_THREADS || 445 numdg < 0 || numdg > MAX_THREADS || 446 seminit < 1 || 447 elapse < 1 || 448 load < 0 || load > 999 || 449 interval < 0 || interval > 999 450 ) { 451 printk("Parameter out of range\n"); 452 return -ERANGE; 453 } 454 455 if ((numsp | nummx | numsm | numrd | numwr | numdg) == 0) { 456 int num = num_online_cpus(); 457 458 if (num > MAX_THREADS) 459 num = MAX_THREADS; 460 numsp = nummx = numsm = numrd = numwr = numdg = num; 461 462 load = 1; 463 interval = 1; 464 do_sched = 1; 465 printk("No parameters - using defaults.\n"); 466 } 467 468 if (verbose) 469 printk("\nStarting synchronisation primitive tests...\n"); 470 471 spin_lock_init(&spinlock); 472 mutex_init(&mutex); 473 sema_init(&sem, seminit); 474 init_rwsem(&rwsem); 475 atomic_set(&do_stuff, 1); 476 477 /* kick off all the children */ 478 for (loop = 0; loop < MAX_THREADS; loop++) { 479 if (loop < numsp) { 480 init_completion(&sp_comp[loop]); 481 kthread_run(spinlocker, (void *) loop, 482 "Spinlock%lu", loop); 483 } 484 485 if (loop < nummx) { 486 init_completion(&mx_comp[loop]); 487 kthread_run(mutexer, (void *) loop, "Mutex%lu", loop); 488 } 489 490 if (loop < numsm) { 491 init_completion(&sm_comp[loop]); 492 kthread_run(semaphorer, (void *) loop, "Sem%lu", loop); 493 } 494 495 if (loop < numrd) { 496 init_completion(&rd_comp[loop]); 497 kthread_run(reader, (void *) loop, "Read%lu", loop); 498 } 499 500 if (loop < numwr) { 501 init_completion(&wr_comp[loop]); 502 kthread_run(writer, (void *) loop, "Write%lu", loop); 503 } 504 505 if (loop < numdg) { 506 init_completion(&dg_comp[loop]); 507 kthread_run(downgrader, (void *) loop, "Down%lu", loop); 508 } 509 } 510 511 /* set a stop timer */ > 512 init_timer(&timer); > 513 timer.function = stop_test; 514 timer.expires = jiffies + elapse * HZ; 515 add_timer(&timer); 516 517 /* now wait until it's all done */ 518 for (loop = 0; loop < numsp; loop++) 519 wait_for_completion(&sp_comp[loop]); 520 521 for (loop = 0; loop < nummx; loop++) 522 wait_for_completion(&mx_comp[loop]); 523 524 for (loop = 0; loop < numsm; loop++) 525 wait_for_completion(&sm_comp[loop]); 526 527 for (loop = 0; loop < numrd; loop++) 528 wait_for_completion(&rd_comp[loop]); 529 530 for (loop = 0; loop < numwr; loop++) 531 wait_for_completion(&wr_comp[loop]); 532 533 for (loop = 0; loop < numdg; loop++) 534 wait_for_completion(&dg_comp[loop]); 535 536 atomic_set(&do_stuff, 0); 537 del_timer(&timer); 538 539 if (spin_is_locked(&spinlock)) 540 printk(KERN_ERR "Spinlock is still locked!\n"); 541 542 if (mutex_is_locked(&mutex)) 543 printk(KERN_ERR "Mutex is still locked!\n"); 544 545 /* count up */ 546 spinlock_total = total("SP ", spinlocks_taken, numsp); 547 mutex_total = total("MTX", mutexes_taken, nummx); 548 sem_total = total("SEM", semaphores_taken, numsm); 549 rd_total = total("RD ", reads_taken, numrd); 550 wr_total = total("WR ", writes_taken, numwr); 551 dg_total = total("DG ", downgrades_taken, numdg); 552 553 /* print the results */ 554 if (verbose) { 555 printk("spinlocks taken: %u\n", spinlock_total); 556 printk("mutexes taken: %u\n", mutex_total); 557 printk("semaphores taken: %u\n", sem_total); 558 printk("reads taken: %u\n", rd_total); 559 printk("writes taken: %u\n", wr_total); 560 printk("downgrades taken: %u\n", dg_total); 561 } 562 else { 563 char buf[30]; 564 565 sprintf(buf, "%d/%d", interval, load); 566 567 printk("%3d %3d %3d %3d %3d %3d %c %5s %9u %9u %9u %9u %9u %9u\n", 568 numsp, nummx, numsm, numrd, numwr, numdg, 569 do_sched ? 's' : '-', 570 buf, 571 spinlock_total, 572 mutex_total, 573 sem_total, 574 rd_total, 575 wr_total, 576 dg_total); 577 } 578 579 /* tell insmod to discard the module */ 580 if (verbose) 581 printk("Tests complete\n"); 582 return -ENOANO; 583 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation