Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ebitmap optimizations #360

Closed
wants to merge 7 commits into from
Closed

Conversation

cgzones
Copy link
Contributor

@cgzones cgzones commented Jul 5, 2022

No description provided.

@cgzones cgzones force-pushed the ebitmap_opt branch 3 times, most recently from ff2dea4 to 8eeed1e Compare July 12, 2022 16:06
Preparation for several ebitmap related optimizations.

Signed-off-by: Christian Göttsche <[email protected]>
---
v2:
  - add more tests for multi node ebitmaps and for bits set at node
    bounds
  - test ebitmap_for_each_bit()
Add an initializer for ebitmaps that sets all bits in a given range to
save node traversals for each bit to set, compared to calling
ebitmap_init() followed by iterating ebitmap_set_bit().

Signed-off-by: Christian Göttsche <[email protected]>
---
v2:
  use braces for all if-else branches when used for at least one of them
Especially in the case of __cil_permissionx_expr_range_to_bitmap_helper()
it substitutes hundreds of thousand of calls to ebitmap_set_bit() during
semodule(8) on a policy widely using extended permissions.

Signed-off-by: Christian Göttsche <[email protected]>
Iterate on nodes instead of single bits to save node resolution for each
single bit.

Signed-off-by: Christian Göttsche <[email protected]>
Iterate on nodes instead of single bits to save node resolution for each
single bit.

Signed-off-by: Christian Göttsche <[email protected]>
---
v2:
  use braces for all if-else branches when used for at least one of them
Iterate on nodes instead of single bits to save node resolution for each
single bit.

Signed-off-by: Christian Göttsche <[email protected]>
The three members of struct ebitmap_node are all unconditionally
initialized.  Hinder compilers to optimize malloc() and memset() into
calloc(), which might be slightly slower.  Especially affects
ebitmap_or().

Signed-off-by: Christian Göttsche <[email protected]>
@fishilico
Copy link
Member

@fishilico fishilico closed this Aug 28, 2022
@cgzones cgzones deleted the ebitmap_opt branch August 30, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants