public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: Greg KH <gregkh@suse.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] tty: rework pty count limiting
Date: Tue, 03 Jan 2012 02:21:46 +0400	[thread overview]
Message-ID: <4F022DFA.1090105@openvz.org> (raw)
In-Reply-To: <20120102172903.GB19782@suse.de>

Greg KH wrote:
> On Mon, Jan 02, 2012 at 09:23:01PM +0400, Konstantin Khlebnikov wrote:
>> After adding devpts multiple-insrances sysctl kernel.pty.max limit pty count for
>> each devpts instance independently, while kernel.pty.nr shows total pty count.
>>
>> This patch restores sysctl kernel.pty.max as global limit (4096 by default),
>> adds pty reseve for main devpts (mounted without "newinstance" argument),
>> and new sysctl to tune it: kernel.pty.reserve (1024 by default)
>>
>> Also it adds devpts mount option "max=%d" to limit pty count for each devpts
>> instance independently. (by default NR_UNIX98_PTY_MAX == 2^20)
>>
>> Thus devpts instances in containers cannot eat up all available pty even if we didn't
>> set any limits, while with "max" argument we can adjust limits more precisely.
>>
>> Plus, now open("/dev/ptmx") return -ENOSPC in case lack of pty indexes,
>> this is more informative than -EIO.
>
> That's a userspace api change, why is this going to be allowed?

open() can return -ENOSPC in case normal fs,
meanwhile error codes for /dev/ptmx wasn't documented at all:
there is nothing in manpage pts, pty and ptmx.
manpage posix_openpt and getpt refers to manpage open(2).
I can return EIO back, if this is critical.

>
> greg k-h

  reply	other threads:[~2012-01-02 22:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-02 17:22 [PATCH 1/2] tty: move pty count limiting into devpts Konstantin Khlebnikov
2012-01-02 17:23 ` [PATCH 2/2] tty: rework pty count limiting Konstantin Khlebnikov
2012-01-02 17:29   ` Greg KH
2012-01-02 22:21     ` Konstantin Khlebnikov [this message]
2012-01-03  0:43       ` Alan Cox
2012-01-05  0:24 ` [PATCH 1/2] tty: move pty count limiting into devpts Greg KH
2012-01-05  9:06   ` [PATCH for tty-next " Konstantin Khlebnikov
2012-01-05  9:06   ` [PATCH for tty-next 2/2] tty: rework pty count limiting Konstantin Khlebnikov

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=4F022DFA.1090105@openvz.org \
    --to=khlebnikov@openvz.org \
    --cc=gregkh@suse.de \
    --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