This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about madvise(DONTNEED) in glibc malloc


(4/15/13 3:09 AM), OndÅej BÃlka wrote:
> On Sun, Apr 14, 2013 at 06:28:48PM -0700, KOSAKI Motohiro wrote:
>>>>  Performance counter stats for './ebizzy -S 3':
>>>>
>>>>       23919.162533 task-clock                #    7.945 CPUs utilized
>>>>              2,533 context-switches          #    0.106 K/sec
>>>>                 77 CPU-migrations            #    0.003 K/sec
>>>>              4,256 page-faults               #    0.178 K/sec
>>>
>>> This doesn't prove that glibc use of MADV_DONTNEED is wrong.  What
>>> this proves is that never giving memory back to the system results in
>>> crazy fast performance since we reduce syscall overhead.  It doesn't
>>> justify never returning memory back to the system though.
>>
>> One more. You know, "the light weight" syscall has two type. 1) most optimal
>> behavior when application's prediction is 100% correct. MADV_DONTNEED is this.
>> kernel doesn't have any heuritics, no add any additional lock. just drop pages
>> quickly. 2) most optimal behavior when application's prediction is 50-80% correct.
>> current vrange() proposal is this. kernel take an argument just as a hint. and
>> discard only when system meet memory starvation. of cource, this has side effect.
>> need some additional lock and then the peformance is worse then the prediction is
>> always correct.
>>
> Dropping pages is not optimal behaviour. You can get better by reusing
> them.

Sorry, I can't understand what you tried say. Have you take a look current DONTNEED implementation?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]