NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/44969: vmem_xalloc() don't search best-fit free segment in spite of VMEM_BESTFIT



The following reply was made to PR kern/44969; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/44969: vmem_xalloc() don't search best-fit free segment in
 spite of VMEM_BESTFIT
Date: Tue, 19 Jul 2011 02:47:42 +0000

 On Tue, Jul 12, 2011 at 07:10:06AM +0000, David Laight wrote:
  >>> Though you call vmem_xalloc() with VM_BESTFIT(allocation strategy),
  >>> you find that vmem_xalloc() don't search best-fit free segment. 
  >>> VMEM_BESTFIT means that using the smallest free segment that can satisfy
  >>> the allocation.But current implementation use the free segment which is
  >>> found at first.(not search best-fit free segment)
  >>  
  >>  it's an intended behaviour.
  >>  have you seen space efficiency problems due to this?
  >  
  >  Not here, but I've had serious problems with 'first free' causing
  >  excessive fragmentation in the past.
  >  In that case changing the code to do 'best fit' completely removed
  >  the fragmentation issue.
 
 In general/on average first-fit, next-fit, and best-fit tend to do
 about the same, but for specific workloads one or another may be
 markedly better.
 
 ISTM that if the caller asks for best fit, the caller should get best
 fit, and callers should ask specifically for a particular method only
 when they care and get the default otherwise.
 
 Oh hm.
 
               The allocation strategy is one of:
 
               VM_BESTFIT     Prefer space efficiency.
               VM_INSTANTFIT  Prefer performance.
 
 that's rather bollocks...
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index