You wear cotton beneath the chainmail. And yes, discomfort is there, but you are at a major advantage when slashing attacks don't work on you. Only a thrust from a sword or spear can break through chainmail, and that too not that deeply. The central asian armies wore chainmail as standard even in the hot deserts of rajasthan with good results. What would you prefer, feeling hot, or to have a large gushing wound accross your chest? During the crusades, the combination of chainmail and thick cotton gambisons beneath it made the christian knights almost impervious to horse archery, which allowed them to get close for lance attacks. This was in the hot deserts of palestine.