Re: [PATCH] Improving read/write/close system call reliability when used with pthreads

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

 



Paul,

Paul Jackson wrote:
You suspected correctly - Apple Mail line wrapped it at 72 columns
(added newlines in any line going past column 72.)  This makes it
impossible to apply the patch without alot of hand editing.

Of course, sorry about that. New try!

Regarding the FIXME: Marking bad fd:s in close currently walks all tasks, but it ought to be possible to do this much more efficiently. For example only tasks that actually use the file table in question. Alternatively, only tasks that are waiters in the pipe_inode_info- >wait queue (they are the ones that are woken up to handle the close anyway; the wake up btw can perhaps also be more fine-grained).

I have a feeling that the latter is the most efficient, but perhaps a bit more tricky regarding races. Plus, this puts the burden of marking bad fd:s onto all the implementations of the f_op->closing_fd file operation.

The rest of the bookkeeping to handle required_fds should be efficient, I believe.

Regarding generality: For maximum benefit of being able to close all kinds even non-pipe fd:s reliably, a lot of places need to be updated. This is not a requirement though, as current behaviour is maintained otherwise. (It might however be worthwhile to have sys_read/sys_write etc. refuse -ERESTARTSYS when its fd apparently is bad.)

Cheers,
Fredrik

Attachment: required-fds.patch
Description: Binary data


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux