Re: [PATCH resend] rewrite AF_UNIX garbage collector, fixes race

From: David Miller
Date: Wed Jul 11 2007 - 22:29:30 EST


From: Miklos Szeredi <miklos@xxxxxxxxxx>
Date: Wed, 04 Jul 2007 11:49:41 +0200

> 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.
>
> See comments inside patch for the description of the algorithm.
>
> Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>

This looks good, patch applied and I'll get this into the
2.6.23 merge window.

Once this sits around for a while and we feel super-confident
with it we can consider a backport into -stable.

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