Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754066AbdHXXCA (ORCPT ); Thu, 24 Aug 2017 19:02:00 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:58900 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753566AbdHXXB6 (ORCPT ); Thu, 24 Aug 2017 19:01:58 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Linus Torvalds Cc: Christian Brauner , Al Viro , Serge Hallyn , Stefan Lippers-Hollmann , Christian Brauner , Thorsten Leemhuis , Linux Kernel Mailing List References: <20170816171211.4021-1-christian.brauner@ubuntu.com> <87ziazqdfr.fsf@xmission.com> <20170824022436.44adb497@mir> <87378hhi3y.fsf@xmission.com> <87wp5tfynr.fsf@xmission.com> <20170824062432.1e05e6f8@mir> <874lsxezal.fsf@xmission.com> <87y3q8ermg.fsf@xmission.com> <874lswae8b.fsf@xmission.com> Date: Thu, 24 Aug 2017 18:01:36 -0500 In-Reply-To: (Linus Torvalds's message of "Thu, 24 Aug 2017 14:07:46 -0700") Message-ID: <877exs7epb.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1dl18I-0006tr-JS;;;mid=<877exs7epb.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=67.3.200.44;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/7ufcA5eFwC/enLM2LJeP7Dk8xeBHWFlc= X-SA-Exim-Connect-IP: 67.3.200.44 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.1 XMSolicitRefs_0 Weightloss drug * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_03 6+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 5681 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.5 (0.0%), b_tie_ro: 1.76 (0.0%), parse: 0.84 (0.0%), extract_message_metadata: 14 (0.2%), get_uri_detail_list: 1.83 (0.0%), tests_pri_-1000: 7 (0.1%), tests_pri_-950: 1.15 (0.0%), tests_pri_-900: 0.96 (0.0%), tests_pri_-400: 25 (0.4%), check_bayes: 24 (0.4%), b_tokenize: 8 (0.1%), b_tok_get_all: 9 (0.2%), b_comp_prob: 2.6 (0.0%), b_tok_touch_all: 2.7 (0.0%), b_finish: 0.53 (0.0%), tests_pri_0: 194 (3.4%), check_dkim_signature: 0.51 (0.0%), check_dkim_adsp: 3.2 (0.1%), tests_pri_500: 5434 (95.6%), poll_dns_idle: 5427 (95.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2703 Lines: 66 Linus Torvalds writes: > On Thu, Aug 24, 2017 at 1:43 PM, Eric W. Biederman > wrote: >> >> There are just enough weird one off scripts like xen image builder (I >> think that was the nasty test case that broke in debian) that I can't >> imagine ever being able to responsibly remove the path based lookups in >> /dev/ptmx. I do dream of it sometimes. > > Not going to happen. Which is what I said. > The fact is, /dev/ptmx is the simply the standard location. > /dev/pts/ptmx simply is *not*. The standard is posix_openpt(). That is a syscall on the bsds. Opening something called ptmx at this point is a Linuxism. There are a lot of programs that are going to be calling posix_openpt() simply because /dev/ptmx can not be counted on to exist. > So pretty much every single user that ever uses pty's will use > /dev/ptmx, it's just how it has always worked. > > Trying to change it to anything else is just stupid. There's no > upside, there is only downsides - mainly the "we'll have to support > the standard way anyway, that newfangled way doesn't add anything". Except the new fangled way does add quite a bit. Not everyone who mounts devpts has permission to call mknod. So /dev/ptmx frequently winds up either being a bind mount or a symlink to /dev/pts/ptmx in containers. It is going to take a long time but device nodes like one of those filesystem features thare are very slowly on their way out. > Our "pts" lookup isn't expensive. > > So quite frankly, we should discourage people from using the > non-standard place. It really has no real advantages, and it's simply > not worth it. The "pts" lookup admitted isn't runtime expensive. I could propbably measure a cost but anyone who is creating ptys fast enough to care likely has other issues. The "pts" lookup does have some real maintenance costs as it takes someone with a pretty deep understanding of things to figure out what is going on. I hope things have finally been abstracted well enough, and the code is used heavily enough we don't have to worry about a regression there. I still worry. As for non-standard locations. Anything that isn't /dev/ptmx and /dev/pts/NNN simply won't work for anything isn't very specialized. At which point I don't think there is any reason to skip using the ptmx node on the devpts filesystem as you have already given up compatibility with everything else. But I agree it doesn't look worth it to change glibc to deal with an alternate location for /dev/ptmx. I see a huge point in changing glibc to use the new TIOCGPTPEER ioctl when available as that is really the functionality the glibc internals are after. Eric