The invention provides a locking mechanism. The locking mechanism comprises a locking pin and a locking piece, the locking pin is provided with a cap portion and a rod portion, the rod portion is provided with a peripheral ring groove, and the rod portion stretches out of the end in the direction where the ring groove starts to be away from the cap portion starting; the locking piece is provided with a first side wall, a second side wall and a connection wall for connecting the first the side wall and the second side wall, the first side wall and the second side wall are arranged in a spaced mode, the first side wall is provided with a partial big hole and a partial small hole which are communicated with each other, the second side wall is provided with a U-shaped hole and a protruding tongue, the protruding tongue extends from the side, away from the connection wall, of the second side wall into the U-shaped hole in a protruding mode, a gap exists between the protruding tongue and the bottom edge of the U-shaped hole, the side, away from the connection wall, of the second side wall at least reaches the position of the partial big hole, the protruding tongue reaches the position above the partial small hole, the interval between the protruding tongue and the first side wall is smaller than the length of the end, and the diameter of the partial big hole is larger than that of the rod portion and that of the end while the diameter of the partial small hole is smaller than the diameter of the end but larger than the diameter of the ring groove. The invention further provides a locking structure with a brake pedal arm and vacuum booster push rods. The locking mechanism and the locking structure have the advantages of being easy to machine and convenient to disassemble and assemble.