HomeFreeBSD

Prevent arc_c collapse

Description

Prevent arc_c collapse

Adjusting arc_c directly is racy because it can happen in the context
of multiple threads. It should always be >= 2 * maxblocksize. Set it
to a known valid value rather than adjusting it directly.

In addition refactor arc_shrink() to a simpler structure, protect against
underflow in the calculation of the new arc_c value.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reverts: 935434ef
Closes: #3904
Closes: #4161

Details

Provenance
Tim Chase <tim@chase2k.com>Authored on Jan 22 2016, 1:37 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 25 2016, 6:25 PM
Parents
rG957dc93242bf: kobj_read_file: Return -1 on vn_rdwr() error
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG1b8951b319b7: Prevent arc_c collapse (authored by Tim Chase <tim@chase2k.com>).Jan 25 2016, 6:25 PM