[SSSD] [PATCH] Handle multiple simultaneous enumeration requests

Simo Sorce ssorce at redhat.com
Tue Sep 7 15:25:00 UTC 2010


On Thu, 02 Sep 2010 09:13:24 -0400
Stephen Gallagher <sgallagh at redhat.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Simo made some style-related comments on IRC which I have incorporated
> into this second version of the patch.
> 
> It changes the function declarations so that the return type is on the
> same line as the function name, and it moves the assorted tevent_req
> functions up in line with the original NSS call, so it reads more
> naturally.

The patch looks quite good, and I also trust it works well given both
Steve and Jakub tested it.

But this is still a Nack.
Summarizing a discussion between Steve and I on IRC:
the current code throws away the cache as soon as the last client is
finished with it. So if a single client performs multiple operations,
(or multiple client just never hit the same window) it means we have
no0 benefit from the cache as it will be thrown away and rebuilt
multiple times.

Instead of refcounting and discarding it immediately when the refcount
goes to zero we decided that it is probably more CPU efficient to
always just discard when the cache times out. The code is already built
to cope with that case anyway so it should be a minor change.

This means that with some huge directories we will consume a little bit
more memory, but if enumerations are really rarely used this shouldn't
be a huge issue as unused memory can always be swapped out. Besides we
are expiring the cache and freeing it, so if it is only rarely used
then most of the time we will not use all that memory, and if it is
often used our memory consumption will not change much, as we keep
releasing and reacquiring more or less the same amount of memory.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York



More information about the sssd-devel mailing list