#3572 mmap cache: memory mapped cache cannot use all allocated memory in the data table
Closed: cloned-to-github 3 years ago by pbrezina. Opened 6 years ago by sbose.

In sss_mmap_cache_init() we set a payload depending of the type of
cached data, e.g. for passwd data 4 * MC_SLOT_SIZE or for group data 3 *
MC_SLOT_SIZE. This value is used to calculate the data table size:

#define MC_DT_SIZE(elems, payload) ( (elems) * (payload) )

    mc_ctx->dt_size = MC_DT_SIZE(n_elem, payload);

since this does not change the slot size there is now room for e.g
(n_elem * 4) slots for passwd data, which makes sense since we assume
that a typical passwd entry will occupy 4 slot and we want the cache to
be able to store n_elem passwd entries.

But the memory for the tree table is calculated only with n_elem

#define MC_FT_SIZE(elems) ( (elems) / 8 )

    mc_ctx->ft_size = MC_FT_SIZE(n_elem);

This means that although we allocated memory for e.g. (4 * n_elem) slots
we can only handle n_elem slots because there are only n_elem bits in
the free table. As a result 3/4 of the allocate memory for the data is
unused and entries in the cache are overwritten earlier than needed.

I would suggest to just use a factor for the payload and increase the free table wih this factor as well.


Since this is not a pressing issue, but just not all the space is used, I'm filing the bug into the milestone after the next one. It might be a good idea to fix along with the refactoring of the memory cache in sssd-2.0.

Metadata Update from @jhrozek:
- Issue set to the milestone: SSSD 2.0

6 years ago

Metadata Update from @jhrozek:
- Issue priority set to: minor
- Issue tagged with: bug

6 years ago

Metadata Update from @jhrozek:
- Issue set to the milestone: SSSD 2.1 (was: SSSD 2.0)

5 years ago

Metadata Update from @jhrozek:
- Issue set to the milestone: SSSD 2.2 (was: SSSD 2.1)

5 years ago

Metadata Update from @jhrozek:
- Issue set to the milestone: SSSD 2.3 (was: SSSD 2.2)

4 years ago

Metadata Update from @thalman:
- Issue tagged with: Future milestone

4 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/4596

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @pbrezina:
- Issue close_status updated to: cloned-to-github
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata