|
|
Created:
4 years, 11 months ago by haraken Modified:
4 years, 9 months ago CC:
chromium-reviews, oilpan-reviews, Mads Ager (chromium), blink-reviews, blink-reviews-wtf_chromium.org, kouhei+heap_chromium.org, Mikhail Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionPartitionAlloc: Increase the number of pages per bucket
Currently the number of pages per bucket is limited to 2^16,
and this has caused a bunch of crash reports at partitionBucketFull().
This CL increase the limit to 2^24 instead of decreasing the limit of
|numSystemPagesPerSlotSpan| to 2^8 (It is statically guaranteed that |numSystemPagesPerSlotSpan|
does not exceed 2^8). As a result, this CL doesn't change sizeof(PartitionBucket).
BUG=87772
Committed: https://crrev.com/63f7a4e7c4255204a90569f7ace2d3aeddcea22e
Cr-Commit-Position: refs/heads/master@{#371745}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #
Total comments: 7
Patch Set 4 : #Patch Set 5 : #Patch Set 6 : #Patch Set 7 : #Messages
Total messages: 36 (15 generated)
Description was changed from ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). As far as I understand, the reason we wanted to limite the number to 2^16 is to slim down sizeof(PartitionBucket). However, I don't think that the sizeof(PartitionBucket) matters becuase we allocate only one PartitionBucket per bucket. Even if we increae the number to 2^32, it wouldn't cause any performance or memory regression (I hope). BUG=87772 ========== to ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). As far as I understand, the reason we wanted to limite the number to 2^16 is to slim down sizeof(PartitionBucket). However, I don't think that the sizeof(PartitionBucket) matters becuase we allocate only one PartitionBucket per bucket. Even if we increase the number to 2^32, it wouldn't cause any performance or memory regression (I hope). BUG=87772 ==========
haraken@chromium.org changed reviewers: + bashi@chromium.org, tyoshino@chromium.org
PTAL In terms of memory, I'm pretty sure that this CL won't regress anything. The number of PartitionBuckets allocated in PartitionAlloc is limited. In terms of performance, I don't think this CL will regress anything but I'll keep an eye on the perf bots.
It looks like I need to fix crashes in the bots.
Description was changed from ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). As far as I understand, the reason we wanted to limite the number to 2^16 is to slim down sizeof(PartitionBucket). However, I don't think that the sizeof(PartitionBucket) matters becuase we allocate only one PartitionBucket per bucket. Even if we increase the number to 2^32, it wouldn't cause any performance or memory regression (I hope). BUG=87772 ========== to ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). This CL increase the limit to 2^24 instead of decreasing the limit of |numSystemPagesPerSlotSpan| to 2^8 (It is statically guaranteed that |numSystemPagesPerSlotSpan| does not exceed 2^8). As a result, this CL doesn't change sizeof(PartitionBucket). BUG=87772 ==========
OK, I invented a better idea that doesn't increase sizeof(PartitionBucket) :) PTAL at PS2.
On 2016/01/25 05:32:31, haraken wrote: > OK, I invented a better idea that doesn't increase sizeof(PartitionBucket) :) > > PTAL at PS2. s/PS2/PS3/.
With PS3 applied, Chrome doesn't crash for the test case by wyantb ( http://code.google.com/p/chromium/issues/detail?id=87772#c60 ).
LGTM with nits https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/wtf/PartitionAlloc.cpp (right): https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/PartitionAlloc.cpp:82: RELEASE_ASSERT(bestPages < (1 << 8)); RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan) ? https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/PartitionAlloc.cpp:102: RELEASE_ASSERT(bestPages < (1 << 8)); ditto. https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/wtf/PartitionAlloc.h (right): https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/PartitionAlloc.h:262: unsigned numSystemPagesPerSlotSpan : 8; uint32_t ? https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/PartitionAlloc.h:263: unsigned numFullPages : 24; ditto.
Thanks for the review! https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/wtf/PartitionAlloc.cpp (right): https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/PartitionAlloc.cpp:82: RELEASE_ASSERT(bestPages < (1 << 8)); On 2016/01/26 23:52:37, bashi1 wrote: > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan) ? No, what I really want to assert here is that the following static_cast<uint8_t> doesn't lose information (i.e., bestPages is less than 1<<8). Given the current configuration of PartitionAlloc, it is statically guaranteed, but it may change if someone changes some constant value of PartitionAlloc. This assertion is here to catch it. https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/wtf/PartitionAlloc.h (right): https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/PartitionAlloc.h:262: unsigned numSystemPagesPerSlotSpan : 8; On 2016/01/26 23:52:37, bashi1 wrote: > uint32_t ? The style checker asks us to use unsigned for a bit-field.
The CQ bit was checked by haraken@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1622553004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1622553004/40001
https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/wtf/PartitionAlloc.cpp (right): https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/PartitionAlloc.cpp:82: RELEASE_ASSERT(bestPages < (1 << 8)); On 2016/01/27 01:19:32, haraken wrote: > On 2016/01/26 23:52:37, bashi1 wrote: > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan) ? > > No, what I really want to assert here is that the following static_cast<uint8_t> > doesn't lose information (i.e., bestPages is less than 1<<8). Given the current > configuration of PartitionAlloc, it is statically guaranteed, but it may change > if someone changes some constant value of PartitionAlloc. This assertion is here > to catch it. > I think it's not the most important thing to ensure bestPages is less than 1<<8. What we really want to do here is to ensure that we don't exceed the maximum number of |PartitionBucket::numSystemPagesPerSlotSpan|, which is logically determined by the size and relationship of system pages and slot spans. 8 bits are just enough bits to store that maximum number.
The CQ bit was unchecked by haraken@chromium.org
On 2016/01/27 01:34:07, bashi1 wrote: > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > File third_party/WebKit/Source/wtf/PartitionAlloc.cpp (right): > > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/wtf/PartitionAlloc.cpp:82: RELEASE_ASSERT(bestPages < > (1 << 8)); > On 2016/01/27 01:19:32, haraken wrote: > > On 2016/01/26 23:52:37, bashi1 wrote: > > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan) ? > > > > No, what I really want to assert here is that the following > static_cast<uint8_t> > > doesn't lose information (i.e., bestPages is less than 1<<8). Given the > current > > configuration of PartitionAlloc, it is statically guaranteed, but it may > change > > if someone changes some constant value of PartitionAlloc. This assertion is > here > > to catch it. > > > > I think it's not the most important thing to ensure bestPages is less than 1<<8. > What we really want to do here is to ensure that we don't exceed the maximum > number of |PartitionBucket::numSystemPagesPerSlotSpan|, which is logically > determined by the size and relationship of system pages and slot spans. 8 bits > are just enough bits to store that maximum number. Then: RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan); and: static_assert(kMaxSystemPagesPerSlotSpan < (1<<8)); ? (I was rather worrying about the former condition since we're truncating the bestPages into uint8_t.)
On 2016/01/27 01:38:58, haraken wrote: > On 2016/01/27 01:34:07, bashi1 wrote: > > > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > > File third_party/WebKit/Source/wtf/PartitionAlloc.cpp (right): > > > > > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > > third_party/WebKit/Source/wtf/PartitionAlloc.cpp:82: RELEASE_ASSERT(bestPages > < > > (1 << 8)); > > On 2016/01/27 01:19:32, haraken wrote: > > > On 2016/01/26 23:52:37, bashi1 wrote: > > > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan) ? > > > > > > No, what I really want to assert here is that the following > > static_cast<uint8_t> > > > doesn't lose information (i.e., bestPages is less than 1<<8). Given the > > current > > > configuration of PartitionAlloc, it is statically guaranteed, but it may > > change > > > if someone changes some constant value of PartitionAlloc. This assertion is > > here > > > to catch it. > > > > > > > I think it's not the most important thing to ensure bestPages is less than > 1<<8. > > What we really want to do here is to ensure that we don't exceed the maximum > > number of |PartitionBucket::numSystemPagesPerSlotSpan|, which is logically > > determined by the size and relationship of system pages and slot spans. 8 > bits > > are just enough bits to store that maximum number. > > Then: > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan); > > and: > > static_assert(kMaxSystemPagesPerSlotSpan < (1<<8)); > > ? > > (I was rather worrying about the former condition since we're truncating the > bestPages into uint8_t.) s/former/latter/
On 2016/01/27 01:39:11, haraken wrote: > On 2016/01/27 01:38:58, haraken wrote: > > On 2016/01/27 01:34:07, bashi1 wrote: > > > > > > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > > > File third_party/WebKit/Source/wtf/PartitionAlloc.cpp (right): > > > > > > > > > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > > > third_party/WebKit/Source/wtf/PartitionAlloc.cpp:82: > RELEASE_ASSERT(bestPages > > < > > > (1 << 8)); > > > On 2016/01/27 01:19:32, haraken wrote: > > > > On 2016/01/26 23:52:37, bashi1 wrote: > > > > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan) ? > > > > > > > > No, what I really want to assert here is that the following > > > static_cast<uint8_t> > > > > doesn't lose information (i.e., bestPages is less than 1<<8). Given the > > > current > > > > configuration of PartitionAlloc, it is statically guaranteed, but it may > > > change > > > > if someone changes some constant value of PartitionAlloc. This assertion > is > > > here > > > > to catch it. > > > > > > > > > > I think it's not the most important thing to ensure bestPages is less than > > 1<<8. > > > What we really want to do here is to ensure that we don't exceed the maximum > > > number of |PartitionBucket::numSystemPagesPerSlotSpan|, which is logically > > > determined by the size and relationship of system pages and slot spans. 8 > > bits > > > are just enough bits to store that maximum number. > > > > Then: > > > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan); > > > > and: > > > > static_assert(kMaxSystemPagesPerSlotSpan < (1<<8)); > > > > ? > > > > (I was rather worrying about the former condition since we're truncating the > > bestPages into uint8_t.) > > s/former/latter/ Yeah, I'd prefer having both.
On 2016/01/27 02:03:47, bashi1 wrote: > On 2016/01/27 01:39:11, haraken wrote: > > On 2016/01/27 01:38:58, haraken wrote: > > > On 2016/01/27 01:34:07, bashi1 wrote: > > > > > > > > > > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > > > > File third_party/WebKit/Source/wtf/PartitionAlloc.cpp (right): > > > > > > > > > > > > > > https://codereview.chromium.org/1622553004/diff/40001/third_party/WebKit/Sour... > > > > third_party/WebKit/Source/wtf/PartitionAlloc.cpp:82: > > RELEASE_ASSERT(bestPages > > > < > > > > (1 << 8)); > > > > On 2016/01/27 01:19:32, haraken wrote: > > > > > On 2016/01/26 23:52:37, bashi1 wrote: > > > > > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan) ? > > > > > > > > > > No, what I really want to assert here is that the following > > > > static_cast<uint8_t> > > > > > doesn't lose information (i.e., bestPages is less than 1<<8). Given the > > > > current > > > > > configuration of PartitionAlloc, it is statically guaranteed, but it may > > > > change > > > > > if someone changes some constant value of PartitionAlloc. This assertion > > is > > > > here > > > > > to catch it. > > > > > > > > > > > > > I think it's not the most important thing to ensure bestPages is less than > > > 1<<8. > > > > What we really want to do here is to ensure that we don't exceed the > maximum > > > > number of |PartitionBucket::numSystemPagesPerSlotSpan|, which is logically > > > > determined by the size and relationship of system pages and slot spans. 8 > > > bits > > > > are just enough bits to store that maximum number. > > > > > > Then: > > > > > > RELEASE_ASSERT(bestPages <= kMaxSystemPagesPerSlotSpan); > > > > > > and: > > > > > > static_assert(kMaxSystemPagesPerSlotSpan < (1<<8)); > > > > > > ? > > > > > > (I was rather worrying about the former condition since we're truncating the > > > bestPages into uint8_t.) > > > > s/former/latter/ > > Yeah, I'd prefer having both. Done.
The CQ bit was checked by haraken@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bashi@chromium.org Link to the patchset: https://codereview.chromium.org/1622553004/#ps60001 (title: " ")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1622553004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1622553004/60001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...) linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by haraken@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bashi@chromium.org Link to the patchset: https://codereview.chromium.org/1622553004/#ps80001 (title: " ")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1622553004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1622553004/80001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/...)
The CQ bit was checked by haraken@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bashi@chromium.org Link to the patchset: https://codereview.chromium.org/1622553004/#ps100001 (title: " ")
Updated the assertions a bit more.
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1622553004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1622553004/100001
Message was sent while issue was closed.
Description was changed from ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). This CL increase the limit to 2^24 instead of decreasing the limit of |numSystemPagesPerSlotSpan| to 2^8 (It is statically guaranteed that |numSystemPagesPerSlotSpan| does not exceed 2^8). As a result, this CL doesn't change sizeof(PartitionBucket). BUG=87772 ========== to ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). This CL increase the limit to 2^24 instead of decreasing the limit of |numSystemPagesPerSlotSpan| to 2^8 (It is statically guaranteed that |numSystemPagesPerSlotSpan| does not exceed 2^8). As a result, this CL doesn't change sizeof(PartitionBucket). BUG=87772 ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). This CL increase the limit to 2^24 instead of decreasing the limit of |numSystemPagesPerSlotSpan| to 2^8 (It is statically guaranteed that |numSystemPagesPerSlotSpan| does not exceed 2^8). As a result, this CL doesn't change sizeof(PartitionBucket). BUG=87772 ========== to ========== PartitionAlloc: Increase the number of pages per bucket Currently the number of pages per bucket is limited to 2^16, and this has caused a bunch of crash reports at partitionBucketFull(). This CL increase the limit to 2^24 instead of decreasing the limit of |numSystemPagesPerSlotSpan| to 2^8 (It is statically guaranteed that |numSystemPagesPerSlotSpan| does not exceed 2^8). As a result, this CL doesn't change sizeof(PartitionBucket). BUG=87772 Committed: https://crrev.com/63f7a4e7c4255204a90569f7ace2d3aeddcea22e Cr-Commit-Position: refs/heads/master@{#371745} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/63f7a4e7c4255204a90569f7ace2d3aeddcea22e Cr-Commit-Position: refs/heads/master@{#371745} |