From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932463AbbJUKJE (ORCPT ); Wed, 21 Oct 2015 06:09:04 -0400 Received: from forward-corp1m.cmail.yandex.net ([5.255.216.100]:48540 "EHLO forward-corp1m.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932289AbbJUKJA (ORCPT ); Wed, 21 Oct 2015 06:09:00 -0400 Authentication-Results: smtpcorp4.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH] TTY, devpts: document pty count limiting From: Konstantin Khlebnikov To: linux-doc@vger.kernel.org, Jonathan Corbet Cc: linux-api@vger.kernel.org, containers@lists.linux-foundation.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Date: Wed, 21 Oct 2015 13:08:54 +0300 Message-ID: <20151021100854.7888.90252.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Logic was changed in kernel 3.4 by commit e9aba5158a80 ("tty: rework pty count limiting") but still isn't documented. Better late than never. Signed-off-by: Konstantin Khlebnikov --- Documentation/filesystems/devpts.txt | 9 +++++++++ Documentation/sysctl/kernel.txt | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/Documentation/filesystems/devpts.txt b/Documentation/filesystems/devpts.txt index 68dffd87f9b7..30d2fcb32f72 100644 --- a/Documentation/filesystems/devpts.txt +++ b/Documentation/filesystems/devpts.txt @@ -51,6 +51,15 @@ where 'ns_exec -cm /bin/bash' calls clone() with CLONE_NEWNS flag and execs /bin/bash in the child process. A pty created by the sshd is not visible in the original mount of /dev/pts. +Total count of pty pairs in all instances is limited by sysctls: +kernel.pty.max = 4096 - global limit +kernel.pty.reserve = 1024 - reserve for initial instance +kernel.pty.nr - current count of ptys + +Per-instance limit could be set by adding mount option "max=". +This feature was added in kernel 3.4 together with sysctl kernel.pty.reserve. +In kernels older than 3.4 sysctl kernel.pty.max works as per-instance limit. + User-space changes ------------------ diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 6fccb69c03e7..01a42021c2e5 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt @@ -63,6 +63,7 @@ show up in /proc/sys/kernel: - printk_delay - printk_ratelimit - printk_ratelimit_burst +- pty/ - randomize_va_space - real-root-dev ==> Documentation/initrd.txt - reboot-cmd [ SPARC only ] @@ -683,6 +684,12 @@ send before ratelimiting kicks in. ============================================================== +pty/: + +See Documentation/filesystems/devpts.txt. + +============================================================== + randomize_va_space: This option can be used to select the type of process address