Linux-kernel mailing list archive 1999-25,: [RFC] struct file handlinhg in ->poll()

# [RFC] struct file handlinhg in ->poll()

Alexander Viro (viro@math.psu.edu)
Thu, 24 Jun 1999 14:06:29 -0400 (EDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: luc_lalonde@videotron.ca: "Sparc5 linux-2.2.10-ac4 compile errors"
- Previous message: Stefan Monnier: "Re: [PATCH] *(int*)0 = 0 & variations"

Linus, just a quick question: what is guaranteed about ->poll()
behaviour? Specifically, can it block before calling poll_wait()? Can it
block other than in poll_wait()?
fcheck() usage in do_select() worries me - if ->poll() may block
before incrementing f_count we have a race on hands right now. Even if it
doesn't block we have an unpleasant problems on SMP. That is, we must
stop sys_close() from removing the file from ->files->fd[] at least for
the period between fcheck() and poll_wait() (or return from ->poll() if it
never calls poll_wait()). Right now it's done with the big lock. Not nice.
Doing that with spinlock (rwlock, actually) might be better, but
__pollwait() may block, AFAICS.
What do you think about replacing fcheck() with fget(); ->poll();
fput();? Are there any reasons not to do it? That would be the simplest
way, IMHO.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: luc_lalonde@videotron.ca: "Sparc5 linux-2.2.10-ac4 compile errors"
- Previous message: Stefan Monnier: "Re: [PATCH] *(int*)0 = 0 & variations"