svn commit: r333669 - in head/sys: dev/vt kern sys teken

Bruce Evans brde at optusnet.com.au
Wed May 16 13:44:58 UTC 2018


On Wed, 16 May 2018, Bruce Evans wrote:

> On Wed, 16 May 2018, [UTF-8] Jean-Sébastien Pédron wrote:
>
>> Author: dumbbell
>> Date: Wed May 16 09:01:02 2018
>> New Revision: 333669
>> URL: https://svnweb.freebsd.org/changeset/base/333669
>> 
>> Log:
>>  teken, vt(4): New callbacks to lock the terminal once
>> 
>>  ... to process input, instead of inside each smaller operations such as
>>  appending a character or moving the cursor forward.
>> ....
>>  The goal is to improve input processing speed of vt(4). As a benchmark,
>>  here is the time taken to write a text file of 360 000 lines (26 MiB) on
>>  `ttyv0`:
>> 
>>    * vt(4), unmodified:      1500 ms
>>    * vt(4), with this patch: 1200 ms
>>    * syscons(4):              700 ms
>
> Syscons was pessimized by a factor of about 12 using related methods
> (excessive layering, aktough not so much locking).  So the correct
> comparison is with unpessimized syscons taking about 60 ms.

Unrelated to my previous reply: this commit breaks syscons (especially
when vt is not configured) by calling pointers that are only initialized
to non-null for vt (subr_terminal.c), so the pointers are null for
syscons.  The following quick fix seems to work.

XX Index: teken.c
XX ===================================================================
XX --- teken.c	(revision 333672)
XX +++ teken.c	(working copy)
XX @@ -136,8 +136,8 @@
XX  teken_funcs_pre_input(const teken_t *t)
XX  {
XX 
XX -	teken_assert(t->t_funcs->tf_pre_input != NULL);
XX -	t->t_funcs->tf_pre_input(t->t_softc);
XX +	if (t->t_funcs->tf_pre_input != NULL)
XX +		t->t_funcs->tf_pre_input(t->t_softc);
XX  }
XX 
XX  static inline void
XX @@ -144,8 +144,8 @@
XX  teken_funcs_post_input(const teken_t *t)
XX  {
XX 
XX -	teken_assert(t->t_funcs->tf_post_input != NULL);
XX -	t->t_funcs->tf_post_input(t->t_softc);
XX +	if (t->t_funcs->tf_post_input != NULL)
XX +		t->t_funcs->tf_post_input(t->t_softc);
XX  }
XX 
XX  static inline void

Bruce


More information about the svn-src-head mailing list