public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Young <sdyoung@vt220.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] change pts allocation behaviour in
Date: Fri, 7 May 2004 05:52:51 -0600	[thread overview]
Message-ID: <20040507115251.GA4873@eviltron.local.lan> (raw)
In-Reply-To: <20040507041442.7e67c15e.akpm@osdl.org>

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.  Using
the patch though, it will only take 257 iterations.  As time goes on and 
ptses get allocated and freed the situation becomes a bit murkier, but 
the patch should still cut down the number of iterations required to find
a free pts.

  Thanks,
  Steve.

  reply	other threads:[~2004-05-07 11:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-07  8:42 [PATCH] change pts allocation behaviour in 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 [this message]
2004-05-07 19:09     ` Andrew Morton

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=20040507115251.GA4873@eviltron.local.lan \
    --to=sdyoung@vt220.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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