mrg 9ba87b8cc3 completely rework the way that orphaned sockets that are being fdpassed
via SCM_RIGHTS messages are dealt with:

1. unp_gc: make this a kthread.

2. unp_detach: go not call unp_gc directly. instead, wake up unp_gc kthread.

3. unp_scan: do not close files here. instead, put them on a global list
   for unp_gc to close, along with a per-file "deferred close count". if
   file is already enqueued for close, just increment deferred close count.
   this eliminates the recursive calls.

3. unp_gc: scan files on global deferred close list. close each file N
   times, as specified by deferred close count in file. continue processing
   list until it becomes empty (closing may cause additional files to be
   queued for close).

4. unp_gc: add additional bit to mark files we are scanning. set during
   initial scan of global file list that currently clears FMARK/FDEFER.
   during later scans, never examine / garbage collect descriptors that
   we have not marked during the earlier scan. do not proceed with this
   initial scan until all deferred closes have been processed. be careful
   with locking to ensure no races are introduced between deferred close
   and file scan.

5. unp_gc: use dummy file_t to mark position in list when scanning. allow
   us to drop filelist_lock. in turn allows us to eliminate kmem_alloc()
   and safely close files, etc.

6. prohibit transfer of descriptors within SCM_RIGHTS messages if
   (num_files_in_transit > maxfiles / unp_rights_ratio)

7. fd_allocfile: ensure recycled filse don't get scanned.


this is 97% work done by andrew doran, with a couple of minor bug fixes
and a lot of testing by yours truly.
2009-03-11 06:05:29 +00:00
..
2009-01-19 14:54:28 +00:00
2009-01-19 14:54:28 +00:00
2009-01-19 14:54:28 +00:00
2009-01-19 14:54:28 +00:00
2009-01-17 07:02:35 +00:00
2009-01-22 14:38:34 +00:00
2009-01-17 07:02:35 +00:00
2009-01-22 14:38:34 +00:00
2009-02-14 20:45:29 +00:00
2009-01-19 14:54:28 +00:00
2009-01-22 14:38:34 +00:00
2009-01-22 14:38:34 +00:00
2009-02-18 13:04:59 +00:00
2009-01-22 14:38:34 +00:00
2009-01-22 14:38:34 +00:00
2009-03-09 16:19:22 +00:00
2009-03-09 16:19:22 +00:00
2009-01-17 07:02:35 +00:00
2009-01-17 07:02:35 +00:00
2009-02-23 20:33:30 +00:00