Cerebral shunts are commonly used to treat hydrocephalus, the swelling of the brain due to excess buildup of cerebrospinal fluid (CSF).