• Andrew Morton's avatar
    [PATCH] con_open() speedup/cleanup · c0719c5a
    Andrew Morton authored
    con_open() is called on every open of the tty, even if the tty is already all
    set up.  We only need to do that initialisation if the tty is being set up
    for the very first time (tty->count == 1).
    
    So do that: check for tty_count == 1 inside console_sem() and if so, bypass
    all the unnecessary initialisation.
    
    
    
    Note that this patch reintroduces the con_close()-vs-init_dev() race+oops. 
    This is because that oops is accidentally prevented because when it happens,
    con_open() reinstalls tty->driver_data even when tty->count > 1.
    
    But that's bogus, and when the race happens we end up running
    vcs_make_devfs() and vcs_remove_devfs() against the same console at the same
    time, producing indeterminate results.
    
    So the race needs to be fixed again, for real.
    c0719c5a
vt.c 72.5 KB