[AF_UNIX]: Rewrite garbage collector, fixes race.
Throw out the old mark & sweep garbage collector and put in a refcounting cycle detecting one. The old one had a race with recvmsg, that resulted in false positives and hence data loss. The old algorithm operated on all unix sockets in the system, so any additional locking would have meant performance problems for all users of these. The new algorithm instead only operates on "in flight" sockets, which are very rare, and the additional locking for these doesn't negatively impact the vast majority of users. In fact it's probable, that there weren't *any* heavy senders of sockets over sockets, otherwise the above race would have been discovered long ago. The patch works OK with the app that exposed the race with the old code. The garbage collection has also been verified to work in a few simple cases. Signed-off-by:Miklos Szeredi <mszeredi@suse.cz> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
mentioned in commit efd3913f
-
mentioned in commit 1191dc51
-
mentioned in commit afcea7e0
-
mentioned in commit 97486fe3
-
mentioned in commit 316696f1
-
mentioned in commit e8e652b8
-
mentioned in commit 53f60c53
-
mentioned in commit 91cf3086
-
mentioned in commit f86c6a0b
-
mentioned in commit d0c6724b
-
mentioned in commit f4eb7e17
-
mentioned in commit f15786d5
-
mentioned in commit 4d382310
-
mentioned in commit 264434cb
-
mentioned in commit 7c6bbcca
-
mentioned in commit 0a36a75b
-
mentioned in commit 45d7a6a9
-
mentioned in commit 5dba713f
-
mentioned in commit 1c869c8f
-
mentioned in commit 258ff14e
-
mentioned in commit 64038c86
-
mentioned in commit 9dc10a65
-
mentioned in commit eae51347
-
mentioned in commit d98b2c0b
-
mentioned in commit 24d246e7
-
mentioned in commit 3c85bd75
-
mentioned in commit d2859556
-
mentioned in commit 31fbf01d
-
mentioned in commit 3a18a6ce
-
mentioned in commit 897b4b44
-
mentioned in commit c5a821b9
-
mentioned in commit 40171642
-
mentioned in commit 4dd72e5c
-
mentioned in commit f30aff55
-
mentioned in commit 903a9818
-
mentioned in commit 6302e1be
-
mentioned in commit 05d2945c
-
mentioned in commit 68b07e0c
-
mentioned in commit 3ae6c70a
-
mentioned in commit 2b5351e5
-
mentioned in commit d9f595d2
-
mentioned in commit fc203c3d