This reminds me of the time I put a photoshop standard gradient (the default option) from black to white vertically or horizontally across a large enough resolution file then looked at the histogram...

certainly not linear ! although I suspect the issue was with the gradient tool, rather than the histogram - although I do wonder ...