Bug 1507035 - Fix run sizes for size classes >= 16KB on systems with large pages. r=njn

Differential Revision: https://phabricator.services.mozilla.com/D11836

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2018-11-14 06:58:53 +00:00
parent d0047119b0
commit c4ea7f7d5a

View File

@ -2890,11 +2890,6 @@ arena_bin_t::Init(SizeClass aSizeClass)
} while (kFixedHeaderSize + (sizeof(unsigned) * try_mask_nelms) > } while (kFixedHeaderSize + (sizeof(unsigned) * try_mask_nelms) >
try_reg0_offset); try_reg0_offset);
// Don't allow runs larger than the largest possible large size class.
if (try_run_size > gMaxLargeClass) {
break;
}
// Try to keep the run overhead below kRunOverhead. // Try to keep the run overhead below kRunOverhead.
if (Fraction(try_reg0_offset, try_run_size) <= kRunOverhead) { if (Fraction(try_reg0_offset, try_run_size) <= kRunOverhead) {
break; break;
@ -2921,6 +2916,13 @@ arena_bin_t::Init(SizeClass aSizeClass)
break; break;
} }
// If next iteration is going to be larger than the largest possible large
// size class, then we didn't find a setup where the overhead is small enough,
// and we can't do better than the current settings, so just use that.
if (try_run_size + gPageSize > gMaxLargeClass) {
break;
}
// Try more aggressive settings. // Try more aggressive settings.
try_run_size += gPageSize; try_run_size += gPageSize;
} }