John Mayer has a confession of his own about that heartfelt, confessional duet with Katy Perry: It almost didn't happen!

'Who You Love,' from Mayer's just-released 'Paradise Valley' album, is a sweet but raw take on the on-again, off-again couple's real-life relationship. But maybe the song, which John had been kicking around for some time, was a bit too real -- he totally gave up on it at one point.

Fortunately, producer Don Was rescued it from the scrap heap. "I had this great verse and this great chorus and I went, 'Oh wow, this is really cool,'" Mayer tells iHeart Radio. "I actually tossed it off for a moment, and Don Was made me play it back again and goes, 'Listen, there's something here.' And I went 'Yeah, its pretty cool.' Sometimes you need someone to tell you it's cool. I thought, 'Wow, this is something that I should at least run by Katy.' Really to be honest, run it by Katy Perry. There's sort of a difference."

John then mustered the courage to share the song with his girlfriend. "I'd be so nervous to do it if I didn't feel like it was actually a really great thing, and so I played it for her and she really got it right off the bat," he says. "She started singing along with the record, and with this little demo -- it was just a verse and a chorus -- and it was really fun."

Sharing such a special experience was a rare opportunity for a songwriter, John knows. "You don't normally get to hear from the girl you're writing a song to. You don't normally get to hear it from her on the same song, so I really enjoyed what her point of view was gonna be when she wrote it," he says.

Maybe Don Was should get a special credit on the track?