Page MenuHomeFreeBSD

linuxkpi: dma_get_cache_alignment(): Fix off-by-one result
ClosedPublic

Authored by olce on Oct 17 2023, 3:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 30 2024, 6:00 AM
Unknown Object (File)
Apr 30 2024, 6:00 AM
Unknown Object (File)
Apr 30 2024, 5:12 AM
Unknown Object (File)
Apr 30 2024, 5:10 AM
Unknown Object (File)
Apr 30 2024, 5:10 AM
Unknown Object (File)
Apr 29 2024, 9:57 PM
Unknown Object (File)
Dec 27 2023, 10:50 AM
Unknown Object (File)
Dec 25 2023, 5:23 PM

Details

Summary

Substituting 'uma_align_cache' by the appropriately named accessor
uma_get_cache_align_mask() made apparent that dma_get_cache_alignment()
was off by one, since it was defined to be the mask derived from the
alignment value.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olce requested review of this revision.Oct 17 2023, 3:02 PM
This revision is now accepted and ready to land.Oct 17 2023, 3:17 PM
olce edited the summary of this revision. (Show Details)

Diff update, remove a superfluous TAB.

This revision now requires review to proceed.Oct 19 2023, 8:16 AM
This revision is now accepted and ready to land.Oct 19 2023, 12:57 PM
bz requested changes to this revision.Oct 19 2023, 1:52 PM

Does this need a separate commit or why can't D42258 just get the fix given the "bug" was introduced there and it's still open?

This revision now requires changes to proceed.Oct 19 2023, 1:52 PM
In D42264#964954, @bz wrote:

Does this need a separate commit or why can't D42258 just get the fix given the "bug" was introduced there and it's still open?

The bug wasn't introduced there. uma_align_cache has the same problem, it's a mask.

In D42264#964954, @bz wrote:

Does this need a separate commit or why can't D42258 just get the fix given the "bug" was introduced there and it's still open?

The bug wasn't introduced there. uma_align_cache has the same problem, it's a mask.

Then either the commit message should be clearer, or better we should fix the current version before changing it so that the 10y old problem isn't first masked by a different change?

In D42264#964960, @bz wrote:

Then either the commit message should be clearer, (...)

The proposed commit message indeed makes sense only in the context of the previous commits of this series. Going to rework it.

In D42264#964960, @bz wrote:

or better we should fix the current version before changing it so that the 10y old problem isn't first masked by a different change?

I don't understand this line of reasoning. The bug isn't masked by a different change, on the contrary IMHO the previous change makes it more apparent. It's actually how I found it!

It's true that the fix could be made a standalone commit which could be committed right away, but a priori I don't think it's worth the effort, given it seems that the whole series is going to get in quite soon, and after all the bug has been there for 10 years as you say.

olce edited the summary of this revision. (Show Details)

Update the commit message.

In D42264#965181, @olce.freebsd_certner.fr wrote:

Update the commit message.

Thanks! That makes it indeed a lot more understandable for history!

This revision is now accepted and ready to land.Oct 19 2023, 5:17 PM