[PATCH] con_open() speedup/cleanup
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.
Showing
Please register or sign in to comment