Re: x86/mce: suspicious RCU usage in 4.13.4
From: Andi Kleen
Date: Tue Oct 10 2017 - 16:14:15 EST
"Luck, Tony" <tony.luck@xxxxxxxxx> writes:
>> for (;;) {
>> entry = mce_log_get_idx_check(mcelog.next);
>
> Can't this get even simpler? Do we need the loop? The mutex
> will now protect us while we check to see if there is a slot
> to stash this new entry. Also just say:
IMHO the warning is just bogus. There's nothing here that actually
uses RCU. I would just remove it.
>> if (entry >= MCE_LOG_LEN) {
>> - set_bit(MCE_OVERFLOW,
>> - (unsigned long *)&mcelog.flags);
>> + set_bit(MCE_OVERFLOW, (unsigned long *)&mcelog.flags);
>
> Need to mutex_unlock(&mce_chrdev_read_mutex); here.
And yes that too.
-Andi