Re: [PATCH v4 14/20] TP-futex: Support userspace reader/writer locks

From: kbuild test robot
Date: Thu Dec 29 2016 - 13:35:56 EST


Hi Waiman,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.10-rc1 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Waiman-Long/futex-Introducing-throughput-optimized-TP-futexes/20161230-020021
config: i386-randconfig-x006-201652 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

kernel/futex.c: In function 'futex_lock':
>> kernel/futex.c:3776:13: warning: 'rspin_timeout' may be used uninitialized in this function [-Wmaybe-uninitialized]
else if (curtime > rspin_timeout)
^
kernel/futex.c:3656:6: note: 'rspin_timeout' was declared here
u64 rspin_timeout;
^~~~~~~~~~~~~

vim +/rspin_timeout +3776 kernel/futex.c

3760
3761 if (!owner_task && (reader_value >= 0)) {
3762 int old_count = reader_value;
3763
3764 /*
3765 * Reset timeout value if the old reader
3766 * count is 0 or the reader value changes and
3767 * handoff time hasn't been reached. Otherwise,
3768 * disable reader spinning if the handoff time
3769 * is reached.
3770 */
3771 reader_value = (uval & FUTEX_TID_MASK);
3772 if (!old_count || (!handoff_set
3773 && (reader_value != old_count)))
3774 rspin_timeout = curtime +
3775 TP_RSPIN_TIMEOUT;
> 3776 else if (curtime > rspin_timeout)
3777 reader_value = -1;
3778 }
3779 if (!handoff_set && (curtime > handoff_time)) {
3780 WARN_ON(READ_ONCE(state->handoff_pid));
3781 WRITE_ONCE(state->handoff_pid, vpid);
3782
3783 /*
3784 * Disable handoff check.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip