Skip to contentSkip to conversation

epoll bits 0.34

PATCH Manfred Spraul 2 participants 2 messages Nov 11, 2002 VFS

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines

- Cleaned up locking

The cleanup is dangerous/broken: You call f_op->poll with disabled interrupts.

Review

Quoted 11 lines
	/* We have to drop the new item inside our item list to keep track of it */
	write_lock_irqsave(&ep->lock, flags);
(quoted diff) +1 -0
+	/* Add the current item to the hash table */
	list_add(&dpi->llink, ep_hash_entry(ep, ep_hash_index(ep, tfile)));
(quoted diff) +3 -0
+	/* Attach the item to the poll hooks and get current event bits */
+	revents = tfile->f_op->poll(tfile, &pt);
+

Which file descriptors are pollable with eventpoll? For example rtc_poll does

   spin_lock_irq();
   do_work();
   spin_unlock_irq();

I'm sure that there are other drivers that are be affected, I haven't checked networking.

And is that really needed? Could you do the real work in the poll callback instead of locking around the f_op call?

--
Manfred

#1 lore raw
Quoted 7 lines · Manfred Spraul

Which file descriptors are pollable with eventpoll? For example rtc_poll does

    spin_lock_irq();
    do_work();
    spin_unlock_irq();
Quoted 5 lines

I'm sure that there are other drivers that are be affected, I haven't checked networking.

And is that really needed? Could you do the real work in the poll callback instead of locking around the f_op call?

I'll take care of it, thx for your precious input.

- Davide