Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(398)

Issue 4634086: code review 4634086: runtime: don't use twice the memory with grsec-like kernels (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by niemeyer
Modified:
10 years, 11 months ago
Reviewers:
CC:
golang-dev, rsc
Visibility:
Public.

Description

runtime: don't use twice the memory with grsec-like kernels grsec needs the FIXED flag to be provided to mmap, which works now. That said, when the allocation fails to be made in the specific address, we're still given back a writable page. This change will unmap that page to avoid using twice the amount of memory needed. It'd also be pretty easy to avoid the extra system calls once we detected that the flag is needed, but I'm not sure if that edge case is worth the effort.

Patch Set 1 #

Patch Set 2 : code review 4634086: runtime: don't use twice the memory with grsec-like kernels #

Patch Set 3 : diff -r c5ff902a17b9 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r f212ec68da3c https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M src/pkg/runtime/linux/mem.c View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 3
niemeyer
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 11 months ago (2011-06-23 20:43:35 UTC) #1
rsc
LGTM but we're not really using the memory anyway.
10 years, 11 months ago (2011-06-23 21:34:54 UTC) #2
niemeyer
10 years, 11 months ago (2011-06-24 03:30:09 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=5b8d744d0d63 ***

runtime: don't use twice the memory with grsec-like kernels

grsec needs the FIXED flag to be provided to mmap, which
works now.  That said, when the allocation fails to be made
in the specific address, we're still given back a writable
page.  This change will unmap that page to avoid using
twice the amount of memory needed.

It'd also be pretty easy to avoid the extra system calls
once we detected that the flag is needed, but I'm not sure
if that edge case is worth the effort.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/4634086
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b