Power Optimization in Embedded Systems via Feedback Control of Resource Allocation