I mean, it seems like it would have been easier and safer for the general public to have police officers stop him frequently on suspicion of knife possession, before he actually stabbed someone (given that 'stop and searches' have been allowed more frequently again even under Sadiq Khan), but there's always some risk they could have had problems from their bosses or the courts as a result.The angry stain on the pavement was stopped so quickly as at least 2 armed officers were tailing him as they knew he was dangerous and going to do something the moment he left prison.
Or, perhaps, the British government could just have employed their counter-terrorism laws in the same cavalier fashion they do against British people with politically incorrect views, declared him to be a member of some group whose name they made up and designated as a renamed version of ISIS, and locked him up for that. Of course, if they started doing that to Saudi-sponsored terrorists, the Saudis might stop buying British weapons to murder Yemeni babies.
Alternatively, if Boris Johnson wasn't a circus clown, he could just have had the SAS arbitarily shoot this guy down in the street and wait to see what came of it.