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

Issue 6856066: runtime: freebsd: use MADV_FREE for runtime.SysUnused (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by dfc
Modified:
11 years, 5 months ago
Reviewers:
dho
Visibility:
Public.

Description

runtime: freebsd: use MADV_FREE for runtime.SysUnused On FreeBSD MADV_DONTNEED is non destructive when used with anonymous memory, ie, it only makes pages marked DONTNEED more likely to be paged out. MADV_FREE on FreeBSD is destructive and will uncommit memory pages. We already use MADV_FREE on darwin so it looks like a good starting point for FreeBSD. Ref: http://www.gossamer-threads.com/lists/linux/kernel/608944 Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=752339#c6

Patch Set 1 #

Patch Set 2 : diff -r 852ee39cc8c4 https://code.google.com/p/go #

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

Messages

Total messages: 3
dho
LGTM
11 years, 5 months ago (2012-11-20 04:17:36 UTC) #1
dfc
On 2012/11/20 04:17:36, dho wrote: > LGTM Whoops - this isn't for submission, i'll leave ...
11 years, 5 months ago (2012-11-20 04:18:05 UTC) #2
dho
11 years, 5 months ago (2012-11-20 04:18:47 UTC) #3
2012/11/19  <dave@cheney.net>:
> Reviewers: dho,
>
> Message:
> On 2012/11/20 04:17:36, dho wrote:
>>
>> LGTM
>
>
> Whoops - this isn't for submission, i'll leave that to JGC

Ha, ok. I'll look at that one once it comes in. Sorry for the confusion.

--dho

> Description:
> runtime: freebsd: use MADV_FREE for runtime.SysUnused
>
> On FreeBSD MADV_DONTNEED is non destructive when used with anonymous
> memory, ie, it only makes pages marked DONTNEED more likely to be paged
> out. MADV_FREE on FreeBSD is destructive and will uncommit memory pages.
> We already use MADV_FREE on darwin so it looks like a good starting
> point for FreeBSD.
>
> Ref: http://www.gossamer-threads.com/lists/linux/kernel/608944
> Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=752339#c6
>
> Please review this at https://codereview.appspot.com/6856066/
>
> Affected files:
>   M src/pkg/runtime/mem_freebsd.c
>
>
> Index: src/pkg/runtime/mem_freebsd.c
> ===================================================================
> --- a/src/pkg/runtime/mem_freebsd.c
> +++ b/src/pkg/runtime/mem_freebsd.c
> @@ -23,9 +23,7 @@
>  void
>  runtime·SysUnused(void *v, uintptr n)
>  {
> -       USED(v);
> -       USED(n);
> -       // TODO(rsc): call madvise MADV_DONTNEED
> +       runtime·madvise(v, n, MADV_FREE);
>  }
>
>  void
>
>
Sign in to reply to this message.

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