lkml.org 
[lkml]   [2004]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] change pts allocation behaviour in
Steve Young <sdyoung@vt220.org> wrote:
>
> On Fri, May 07, 2004 at 04:14:42AM -0700, Andrew Morton wrote:
> > > in the range of 0-255 first. However, if that fails, then it will search the
> > > higher ranges.
> >
> > Wouldn't we be better off with plain old first-fit-from-zero?
>
> In the typical case where <256 pts devices are allocated, you're right that
> there will be no benefit over the first-fit-from-zero implementation. However
> when there are a lot of pts devices in use, the algorithm used for searching
> the high ranges ought to generally find a new pts in fewer iterations than
> just linearly searching from 0 to the maximum pts number. For example, if a
> system allocates 5000 ptses in a row, when it goes to look for a new one with
> first-fit-from-zero, that's 5001 iterations to find an available pts.

first-fit-from-zero does not imply linear search! The idr.c code provides
a logarithmic-time search.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.039 / U:1.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site