Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Issue 235003: Actually on Windows VirtualAlloc'ated address might have bigger alignment tha... (Closed)

Created:
11 years, 3 months ago by antonm
Modified:
9 years, 4 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Actually on Windows VirtualAlloc'ated address might have bigger alignment than reported by SYSTEM_INFO.dwPageSize, see SYSTEM_INFO.dwAllocationGranularity. As coalescing of spans in tcmalloc requires that those spans are physically adjacent, using smaller alignment inhibited coalescing. Additional benefit is we now require ways less memory at least in some case. BUG=22701 Committed from issue: http://codereview.chromium.org/222028 at rev http://src.chromium.org/viewvc/chrome?view=rev&revision=27162

Patch Set 1 #

Total comments: 6

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -6 lines) Patch
M third_party/tcmalloc/port.cc View 1 2 chunks +9 lines, -6 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
sgk
two style nits (Code seems right to me, but others should weigh in.) http://codereview.chromium.org/235003/diff/1/2 File ...
11 years, 3 months ago (2009-09-24 17:08:48 UTC) #1
antonm
Thanks a lot for review, Steven. http://codereview.chromium.org/235003/diff/1/2 File third_party/tcmalloc/port.cc (right): http://codereview.chromium.org/235003/diff/1/2#newcode74 Line 74: pagesize = ...
11 years, 3 months ago (2009-09-24 17:19:59 UTC) #2
jamesr
On 2009/09/24 17:19:59, antonm wrote: > Thanks a lot for review, Steven. > > http://codereview.chromium.org/235003/diff/1/2 ...
11 years, 3 months ago (2009-09-24 18:21:52 UTC) #3
jamesr
Since Anton is not a Chromium committer I plan to run this patch through the ...
11 years, 3 months ago (2009-09-24 20:38:12 UTC) #4
jar (doing other things)
http://codereview.chromium.org/235003/diff/1/2 File third_party/tcmalloc/port.cc (right): http://codereview.chromium.org/235003/diff/1/2#newcode209 Line 209: void* result = VirtualAlloc(0, size + extra, Note ...
11 years, 3 months ago (2009-09-24 21:17:18 UTC) #5
antonm
Jim, thanks a lot for comments! http://codereview.chromium.org/235003/diff/1/2 File third_party/tcmalloc/port.cc (right): http://codereview.chromium.org/235003/diff/1/2#newcode209 Line 209: void* result ...
11 years, 3 months ago (2009-09-24 21:43:44 UTC) #6
jamesr
On 2009/09/24 21:43:44, antonm wrote: > Jim, thanks a lot for comments! > > http://codereview.chromium.org/235003/diff/1/2 ...
11 years, 3 months ago (2009-09-24 21:56:48 UTC) #7
Anton Muhin
I am fine w/ it. yours, anton. On Fri, Sep 25, 2009 at 1:56 AM, ...
11 years, 3 months ago (2009-09-24 22:12:09 UTC) #8
jamesr
New patch in http://codereview.chromium.org/222028
11 years, 3 months ago (2009-09-24 22:33:23 UTC) #9
jamesr
On 2009/09/24 22:33:23, jamesr wrote: > New patch in http://codereview.chromium.org/222028 http://src.chromium.org/viewvc/chrome?view=rev&revision=27162
11 years, 3 months ago (2009-09-25 01:42:46 UTC) #10
Anton Muhin
11 years, 3 months ago (2009-09-25 12:41:42 UTC) #11
Thinking a bit more about it, is TCMalloc_SystemAlloc a right place
for alignment at all?  I'd rather remove alignment treatment at all,
does anybody know about any compelling reasons to support alignment in
TCMalloc_SystemAlloc at all?

[should I have moved it to some other list?]

yours,
anton.

On Fri, Sep 25, 2009 at 1:43 AM,  <antonm@chromium.org> wrote:
> Jim, thanks a lot for comments!
>
>
> http://codereview.chromium.org/235003/diff/1/2
> File third_party/tcmalloc/port.cc (right):
>
> http://codereview.chromium.org/235003/diff/1/2#newcode209
> Line 209: void* result =3D VirtualAlloc(0, size + extra,
> On 2009/09/24 21:17:18, jar wrote:
>>
>> Note that the requested size potentially includes extra.
>
>> As a result, I would expect that it would be better to inform the
>
> caller that
>>
>> the actual_size is the total requested size, including extra.
>
>> What am I missing?
>
> I put a TODO instead of fixing alignment stuff for one reason: it's kind
> of orthogonal to the problem I try to solve :)
>
> And it is apparently not at all easy. =A0For example, it's not only a
> matter of adding extra, somehow I need to communicate back original
> pointer, before adding adjust, otherwise coalescing with the previous
> span would suffer, correct? =A0And release could should be adjusted as
> well.
>
> Luckily, I would hope tcmalloc is never or rarely invoked with alignment
>>
>> pagesize. =A0And if this change goes in, it'd require > 64K alignment to
>
> expose the bug.
>
> So I thought to postpone fixing those issues. =A0Was it a reasonable
> choice?
>
> http://codereview.chromium.org/235003
>

Powered by Google App Engine
This is Rietveld 408576698