Re: 5.13-rt1 + KVM = WARNING: at fs/eventfd.c:74 eventfd_signal()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 19 Jul 2021 17:38:45 +0200 Paolo Bonzini wrote:
>On 18/07/21 14:42, Hillf Danton wrote:
>>> It's caused by the missing wakeup, i.e. eventfd_signal not really
>>> signaling anything.
>> 
>> Can you please point me to the waiters in the mainline?
>
>It's irqfd_wakeup.

Thanks for your light.

With PREEMPT_RT put aside, the race looks like the following.

	CPU0		CPU1		CPU2
	----		----		----
	lock waitqueue
	wake up waiters
	unlock waitqueue

			lock waitqueue
			no waiter
			unlock waitqueue

					lock waitqueue
					add waiter
					unlock waitqueue

If the missing wakeup on CPU1 is bloody critical to the waiter added on CPU2
then the size of race window is supposed to play magic. The race window can
be simulated by giving up wakeup if trylock fails.

With PREEMPT_RT before your patch, eventfd_wake_count prevents the preempting
waker from acquiring the waitqueue lock and ends up with the race window
widened because of the certainty of missing wakeup.

	CPU0		CPU1
	----		----
	lock waitqueue
	wake
	up  <-- preempt
	waiters
	unlock waitqueue

			lock waitqueue
			add waiter
			unlock waitqueue

With PREEMPT_RT after your patch, the race window goes back to without
PREEMPT_RT because of no occurence of preemption.

But the preempting waker can not make sense without the waiter who is bloody
special. Why is it so in the first place? Or it is not at all but the race
existing from Monday to Friday.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux