Rebased and separated patches proposed by Mike Galbraith <mgalbraith@suse.de> in https://lkml.org/lkml/2012/1/7/17.