Page MenuHomeFreeBSD

loader: bcache read ahead block count should take account the large sectors
ClosedPublic

Authored by tsoome on Jan 14 2017, 5:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 24 2024, 3:21 PM
Unknown Object (File)
Dec 20 2023, 6:33 AM
Unknown Object (File)
Nov 25 2023, 1:39 PM
Unknown Object (File)
Nov 19 2023, 7:59 AM
Unknown Object (File)
Nov 17 2023, 8:00 AM
Unknown Object (File)
Nov 10 2023, 2:13 AM
Unknown Object (File)
Oct 27 2023, 3:49 PM
Unknown Object (File)
Oct 25 2023, 1:38 AM
Subscribers
None

Details

Summary

The loader bcache is implementing simple read-ahead to boost the cache.
The bcache is built based on 512B block sizes, and the read ahead is attempting
to read number of cache blocks, based on amount of the free bcache space.

However, there are devices using larger sector sizes than 512B, most obviously
the CD media is based on 2k sectors. This means the read-ahead can not be just
random number of blocks, but we should use value suitable also for use with
larger sectors, as for example, with CD devices, we should read multiple of 2KB.
Since the sector size from disk interface is not too reliable, i guess we can
just use "good enough" value, so the implementation is rounding down the read
ahead block count to be multiple of 16.

This means we have covered sector sizes to 8k.

In addition, the update does implement the end of cache marker, to help to
detect the possible memory corruption - I have not seen it happening so far,
but it does not hurt to have the detection mechanism in place.

Test Plan

Tested with CD boot with iso build which did gave me the way to reproduce and
understand the issue. Unpatched build was failing on reading some files
(depending on iso build), with patch applied, the problem is confirmed fixed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tsoome retitled this revision from to loader: bcache read ahead block count should take account the large sectors.
tsoome updated this object.
tsoome edited the test plan for this revision. (Show Details)
tsoome added reviewers: imp, allanjude.
allanjude edited edge metadata.

Approved for commit

Maybe wait 72 hours for other reviewers though

This revision is now accepted and ready to land.Jan 14 2017, 5:44 PM

Approved for commit

Maybe wait 72 hours for other reviewers though

Sure. The same update is set up for review at illumos side as well, the more eyes, the better.

tsoome edited edge metadata.

Inserted the comment about idea behind the RE size setup.

This revision now requires review to proceed.Feb 2 2017, 11:07 AM
allanjude edited edge metadata.

approved for commit

This revision is now accepted and ready to land.Feb 6 2017, 8:52 AM
This revision was automatically updated to reflect the committed changes.