is he actually hurting himself or is he doing it in that carefully stagemanaged way? i havent seen him doing it, obviously, but as a person very very experienced in dealing with kids who bash the crap out of themselves i would be inclined to ignore it. unless he has some other problem he is probably doing it because it is something very extreme that is likely to get a reaction - crying, yelling you can easily ignore, but when your child bashes their head against a wall - you want to go to them!
also, it could be that he is simply totally overwhelmed by his feelings of frustration and is expressing them. - my ds1 used to bite himself and on a couple of particulalry scary occasions he threw himself down the stairs!
i would also try to identify triggers and head him off at the pass.
i dont think it is necessarily a bad idea for him to have a pillow to bash. we are all entitled to our feelings and to express them and it is a safe outlet. and you teach him that he screams into the pillow until he feels better, but punish him severely for, say, hitting out. so he learns there is a right way and a wrong way to express his emotions.
and acknowledge his feelings. 'i can tell you feel X, that must be terrible for you' 'oh dear, you sound very upset, have a pillow' stuff like that.
and encourage him to verbalise his feelings. get him to try to tell you how he is feeling if he calm enough, rather than hitting/bashing etc, so eventually he can stop needing a physical outlet.
sorry, i'm waffling on!