From owner-freebsd-current@FreeBSD.ORG Thu Nov 27 00:41:30 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EF3D336; Thu, 27 Nov 2014 00:41:30 +0000 (UTC) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5821C56; Thu, 27 Nov 2014 00:41:29 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id q1so3438417lam.11 for ; Wed, 26 Nov 2014 16:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=qr3xP6+Td0U/PGctFiNSCfoJWWlwe+jZWDeKwQFZ4Vs=; b=irAGvOwz7/nvz4K1fRoN0d7SmP91/pioS9wqYXfmDJx9Ve6yhf+Mvdj+JSdpol/Yni zKVA4g0nhUX9oeIdpIuCSdOCPL5c8yHQspomh3H23SkV8Cu6tBlM45a0k/6twTRtFi7+ Hb0LpqhvTpOj7BXBDXvlULiEtF/HTaCt91ZguW7N7Azf6V4COHRjaPxob9MoJqVcyUnN ggX73ug7h8n/R690JG72gGdfFvjDuumJdRjbgqmepE+MPbb8KNycAz6eUIQwvOxpcGGu uu8KB9uaZ7apkiCBvcpK6wbByY5QH0Jha1afH1H00OBxvQQWAks2TkJ4L2AFhD+GlKy7 m65Q== MIME-Version: 1.0 X-Received: by 10.152.4.233 with SMTP id n9mr20769787lan.61.1417048887683; Wed, 26 Nov 2014 16:41:27 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.25.155.4 with HTTP; Wed, 26 Nov 2014 16:41:27 -0800 (PST) In-Reply-To: <1471750.VzNR6ldJSe@ralph.baldwin.cx> References: <1471750.VzNR6ldJSe@ralph.baldwin.cx> Date: Wed, 26 Nov 2014 16:41:27 -0800 X-Google-Sender-Auth: 1ovkhBAkRuLeByaCXvUZ-ufFQgc Message-ID: Subject: Re: RFC: Remove pty(4) From: Davide Italiano To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: Ed Schouten , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Nov 2014 00:41:30 -0000 On Mon, Aug 25, 2014 at 12:37 PM, John Baldwin wrote: > On Wednesday, August 20, 2014 11:00:14 AM Davide Italiano wrote: >> One of my personal goals for 11 is to get rid of cloning mechanism >> entirely, and pty(4) is one of the few in-kernel drivers still relying >> on such mechanism. >> It's not possible, at least to my understanding, converting pty(4) to >> cdevpriv(9) as happened with other drivers. This is mainly because we >> always need a pair of devices (/dev/ptyXX and /dev/ttyXX) and >> userspace loops over ptyXX and after it successfully opens it tries to >> open the other one with the same suffix. So, having a single device is >> not really enough. >> My option, instead, is that of removing pty(4), which is nothing more >> than a compatibility driver, and move pmtx(4) code somewhere else. >> The main drawback of the removal of this is that it makes impossible >> to run FreeBSD <= 7 jails and SSH into them. I personally don't >> consider this a huge issue, in light of the fact that FreeBSD-7 has >> been EOL for a long time, but I would like to hear other people >> comments. >> >> The code review for the proposed change can be found here: >> https://reviews.freebsd.org/D659 >> >> If I won't get any objection I'll commit this in one week time, i.e. >> August 27th. > > Why not just statically create the pairs in /dev? Use some loader tunable > (kern.ptymax) to set a count on the number of pre-created device pairs to > create and then just explicitly create them in the mod_event handler? It > could default to 100 or so. > Done, thank you for the suggestion, John. root@maxwell:/home/davide # kldload pty root@maxwell/home/davide # sysctl -a |grep pty kern.tty_pty_warningcnt: 1 kern.npty: 32 debug.softdep.emptyjblocks: 0 root@maxwell:/home/davide # ls /dev/pty* /dev/ptyl0 /dev/ptyl2 /dev/ptyl4 /dev/ptyl6 /dev/ptyl8 /dev/ptyla /dev/ptylc /dev/ptyle /dev/ptylg /dev/ptyli /dev/ptylk /dev/ptylm /dev/ptylo /dev/ptylq /dev/ptyls /dev/ptylu /dev/ptyl1 /dev/ptyl3 /dev/ptyl5 /dev/ptyl7 /dev/ptyl9 /dev/ptylb /dev/ptyld /dev/ptylf /dev/ptylh /dev/ptylj /dev/ptyll /dev/ptyln /dev/ptylp /dev/ptylr /dev/ptylt /dev/ptylv https://reviews.freebsd.org/D1238 for review. I hope anybody that raised concerns about the previous patch can try this new one. -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare