p1 to p9 requires mutex value to be=1 to enter into CS, right? But, p10 does UP() to enter CS,Observe the below sequence:
suppose initial value of mutex=1
p1: P(mutex), p1 is in CS, and mutex=0
now, p2 to p9 all 8 processes come to enter into CS, But as mutex=0 they can't and get blocked and enqueued in the list.
Then, p10 comes to enter CS, but according to UP function, if there are waiting processes in the list, so p10 wakes up one by one all processes and thus p2,p3,..,p9 all enter into CS.
Atlast, p10:V(mutex), p10 is in CS and now mutex=1
So, all 10 processes can enter into CS at the same time.