Bugeye, that is a very good solution. Have the prisoners sleep in shifts, even two 12 hour shifts. Lock down the ones sleeping, let the others go eat, exercise, or read, problem solved. Make them swap at the end of each shift. I know it might be hard on guards, however guards could pull the same time frames. Half the prisoners up should only need have the number of guards during the shift while the other half is locked up.
Another thing, if they made marijuana legal, about half the ones in prison for mj use would not be there. Harder drugs keep illegal.
Also, if someone is a shoplifer or steals something without using a weapon, make them work the value off. Like working at a department store in gift wrap, or doing supervised janitorial work. That would save the store some money on janitorial services or extra workers during holidays. Maybe make them unload trucks. This would keep fewer people in prison. Make them also wear an ankle or wrist monitor until their time is up. Violent criminals keep locked up. Druggies can work on road cleanup or garbage pickup.