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

Do not store in LargeObjectCache objects whose sizes align to maxHugeSize #838

Merged
merged 1 commit into from
May 26, 2022

Conversation

dnmokhov
Copy link
Contributor

Description

The following test seg faults on a 64-bit system, because the requested allocation is aligned to 1TB and erroneously attempted to be cached:

#include <tbb/scalable_allocator.h>

int main() { void *p = scalable_aligned_malloc(1030792150873, 64); }

This patch updates sizeInCacheRange to reject maxHugeSize (i.e., any size aligned to it will not be cached), which is just outside the last huge bin:

class LargeObjectCache {
private:
    // Large bins [minLargeSize, maxLargeSize)
    // Huge bins [maxLargeSize, maxHugeSize)
  • - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

@dnmokhov dnmokhov marked this pull request as ready for review May 26, 2022 15:21
Copy link
Contributor

@timmiesmith timmiesmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@dnmokhov dnmokhov merged commit 451e76e into master May 26, 2022
@dnmokhov dnmokhov deleted the dev/dnmokhov/fix-cache-range branch May 26, 2022 17:56
@dnmokhov dnmokhov requested a review from AnuyaWelling2801 May 26, 2022 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants