From: Andrew Morton <akpm@osdl.org>
To: Steve Young <sdyoung@vt220.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] change pts allocation behaviour in
Date: Fri, 7 May 2004 12:09:07 -0700 [thread overview]
Message-ID: <20040507120907.5e23e21c.akpm@osdl.org> (raw)
In-Reply-To: <20040507115251.GA4873@eviltron.local.lan>
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.
prev parent reply other threads:[~2004-05-07 19:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-07 8:42 Steve Young
2004-05-07 9:48 ` [PATCH] change pts allocation behaviour in tty_io.c, v2 Steve Young
2004-05-07 11:14 ` [PATCH] change pts allocation behaviour in Andrew Morton
2004-05-07 11:52 ` Steve Young
2004-05-07 19:09 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040507120907.5e23e21c.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sdyoung@vt220.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®