Skip to content

Do not return error if madvise(PopulateRead) fails - #5123

Merged
timvisee merged 1 commit into
devfrom
madvise-no-error
Sep 23, 2024
Merged

timvisee merged 1 commit into
devfrom
madvise-no-error

Conversation

@xzfc

@xzfc xzfc commented Sep 23, 2024

Copy link
Copy Markdown
Member

Fixup for #5114.

@xzfc
xzfc requested a review from timvisee September 23, 2024 14:42
Comment thread lib/common/memory/src/madvise.rs Outdated
return self.advise(memmap2::Advice::PopulateRead);
match self.advise(memmap2::Advice::PopulateRead) {
Ok(()) => return,
Err(err) => log::warn!("Failed to populate with MADV_POPULATE_READ: {err}"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it's worth to describe it's falling back:

Suggested change
Err(err) => log::warn!("Failed to populate with MADV_POPULATE_READ: {err}"),
Err(err) => log::warn!("Failed to populate with MADV_POPULATE_READ, falling back to naive approach: {err}"),

Same goes for the other instance.

What do you think?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@xzfc
xzfc marked this pull request as ready for review September 23, 2024 14:48
@timvisee timvisee mentioned this pull request Sep 23, 2024
@timvisee
timvisee merged commit e7c445b into dev Sep 23, 2024
@timvisee
timvisee deleted the madvise-no-error branch September 23, 2024 15:08
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.

2 participants