lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50EAB1C1.9050808@imgtec.com>
Date:	Mon, 7 Jan 2013 11:30:09 +0000
From:	James Hogan <james.hogan@...tec.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
CC:	<linux-arch@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	"Arnd Bergmann" <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 43/44] tty/metag_da: Add metag DA TTY driver

Hi Alan,

On 04/01/13 17:00, Alan Cox wrote:
>> Agreed and done. I didn't realise the TTY layer was so prone to
>> providing lots of itty bitty fragments (even with a single 4k write from
>> userland). The thing that really hurt was not the allocations but that
>> each one was written out to the DA separately each incurring it's own
>> large latency. Using a write buffer makes it a lot faster :)
> 
> Think about typing a command and the echo - you get a lot of very small
> writes !

Yes. The case I tried was a large write (strace cat /etc/somefile >
/dev/ttyDA2) and strace showed a single large write, but it got to the
driver in chunks of a dozen or so characters. Is that expected to happen?

>>>> +	channel_driver->init_termios = tty_std_termios;
>>>> +	channel_driver->init_termios.c_cflag =
>>>> +	    B38400 | CS8 | CREAD | HUPCL | CLOCAL;
>>>> +	channel_driver->flags = TTY_DRIVER_REAL_RAW;
>>>
>>> Need to set the speed flags
>>
>> Do you mean c_ispeed, and c_ospeed? These are set in tty_std_termios,
>> and they aren't meaningful in the context of this driver anyway, so are
>> they still necessary?
> 
> You update c_cflag to B38400 so you should set c_ispeed/c_ospeed
> accordingly. For a virtual interface it really only exists so that
> applications have an answer. You want a higher speed like 38400 so that
> apps don't try and do clever stuff for low speed links, that is all
> really.

Okay, assuming no objections I'll do the following to avoid specifying
an arbitrary speed in the first place (since tty_std_termios sets
c_cflag and c_{i,o}speed to 38400 anyway):

@@ -613,8 +613,7 @@ static int __init dashtty_init(void)
 	channel_driver->type = TTY_DRIVER_TYPE_SERIAL;
 	channel_driver->subtype = SERIAL_TYPE_NORMAL;
 	channel_driver->init_termios = tty_std_termios;
-	channel_driver->init_termios.c_cflag =
-	    B38400 | CS8 | CREAD | HUPCL | CLOCAL;
+	channel_driver->init_termios.c_cflag |= CLOCAL;
 	channel_driver->flags = TTY_DRIVER_REAL_RAW;

 	tty_set_operations(channel_driver, &dashtty_ops);

Thanks
James

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ