From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755297AbcEZTc6 (ORCPT ); Thu, 26 May 2016 15:32:58 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36173 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754927AbcEZTc5 (ORCPT ); Thu, 26 May 2016 15:32:57 -0400 Date: Thu, 26 May 2016 22:32:52 +0300 From: Cyrill Gorcunov To: Peter Hurley Cc: LKML , Jiri Slaby , Greg Kroah-Hartman , Andrey Vagin , Pavel Emelianov , Vladimir Davydov , Konstantin Khorenko Subject: Re: [PATCH resend v2] tty: n_tty -- Add new TIOCPEEKRAW ioctl to peek unread data Message-ID: <20160526193252.GB9392@uranus> References: <20160407125326.GH2258@uranus.lan> <570B3980.4040301@hurleysoftware.com> <20160411090149.GA2000@uranus.lan> <570BDCC8.5060104@hurleysoftware.com> <20160411214211.GT2000@uranus.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160411214211.GT2000@uranus.lan> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 12, 2016 at 12:42:11AM +0300, Cyrill Gorcunov wrote: ... > I think so. At least this gives some kind of consistensy while we're > fetching data. Something close to peeking data from pipes/sockets. > > > In that case, I think just write trylocking the termios rwsem should > > prevent any parallel i/o, at least for the N_TTY line discipline. > > > > This should only interfere with processes not being dumped because > > ptrace signalling should have ejected any process to be dumped out > > of their i/o loops (readers or writers). > > > > Also, I think we should further limit the interface based on what is > > supported currently; IOW, check that the driver is either pty or vt, > > assert that the line discipline is N_TTY at both ends, etc. > > Thats a good idea, thanks, will do! It's almost a month passed, so I'm really sorry for delay in response (been trying to implement pty c/r on userspace level together with other stuff). Peter, I believe your initial idea of fetching data via native read inside criu works well for us so far. We've been playing with tests and they are passing just fine. Thanks a huge for all your comments and overall help! Cyrill