During a time when partisanship too often blocks progress in Washington, it’s encouraging to see cooperation on much-needed prison sentencing reform. There is bipartisan agreement that America locks up too many people for amounts of time that don’t fit their crimes. And recent action by Congress and the administration will move American prison policy in the right direction.

More than 95,000 people, nearly half of all federal prisoners, are incarcerated for drug-related crimes, according to the Federal Bureau of Prisons. Many are serving 20 years or more because of minor, nonviolent drug convictions.

In response, the Obama administration is using its authority to commute sentences. About 6,000 federal inmates will be released in a first wave that began last week to ease overcrowding and rightly roll back unreasonably harsh penalties that resulted from the “war on drugs’’ in the 1980s and ’90s. About a third of the inmates are illegal immigrants who committed more serious crimes and will be deported. The remainder will be released to halfway houses or be on home supervision.

In the same spirit, the Senate Judiciary Committee last month passed a measure that would reduce sentences and give judges greater sentencing flexibility for certain low-level drug offenders. The bill is a bipartisan effort by Senate Judiciary Committee Chairman Chuck Grassley, R-Iowa, and Assistant Democratic Leader Dick Durbin, D-Ill.

The measure doesn’t eliminate mandatory minimum prison sentences, but it sensibly reduces them. Parts of the bill are retroactive and will benefit thousands who remain in prison under an outdated, racially biased law that punished crack-cocaine offenses more severely than powder-cocaine offenses. When the law was altered in 2010, the change applied only to new cases, leaving thousands of inmates serving unjustly long sentences.

Those sentences have had a disproportionately negative effect on communities of color. A Child Trends study released last week found that one in 14 children have at least one parent behind bars. For African-­American children, the number is one in nine.

Federal prisons got to this point because lawmakers enacted dozens of rules that required drug offenders to be incarcerated longer. As a result, the federal prison population grew by 800 percent (to more than 200,000) between 1980 and 2013. The administration says the U.S. now spends $80 billion annually on jails and prisons. That’s despite studies showing that boosting the inmate population has not yielded a strong public-safety return on the investment. And even as thousands of drug offenders are locked up, the availability and use of illegal drugs has increased.

During a national police chiefs conference last week in Chicago, some law enforcement leaders expressed worry that releasing more inmates will increase crime. That’s a legitimate concern, but it can be addressed if those who are released receive the kind of support they need to successfully reintegrate into society.