along with being sexual acts involving pain, refers to a part in season 4 of greys anatomy. in this context, it means sex and mockery - a relationship that involves only sex and making fun of each other in a flirtatious way.
derek: meredith, do you wanna get some dinner together tonight?
meredith: derek, no! s and m only!