Original commit message from CVS: Improve the optimal scheduler, mainly element remove and pad disconnect