If I don't think it's safe for someone behind to overtake me, I usually take the lane. If I think it is safe, then I try to give as much room as possible (without getting silly with it - I'm not going to be skimming the verge/kerb). If I'm aware of someone waiting behind me, or I can see someone plenty behind me (or in front coming my way) where it isn't safe to overtake me unless I pull in, then I pull in if I can do so safely. A mirror on my offside handlebar helps a lot, including seeing just how close they're getting.
Most of my road riding is on narrow single track country lanes and so most of the time, pulling over is required even for oncoming vehicles. What really gets my goat is oncoming motor vehicles who blast ahead expecting me to get out of their way - especially if they pass a passing place/field/yard entrance to do so.
Saying all that, it is really heartwarming encountering considerate drivers on the country lanes and I often get (and give) waves of appreciation and thanks - it restores my faith in the human race.
In my experience, the worst roads are those closer to the towns that are double track single carriageway where there's only plenty of room if it's clear. Driving standards seem to get worse the closer you get to a town and I get more drivers that either don't give enough room when it is safe to do so, give plenty of room when it isn't safe to overtake, or a combination of the two. These drivers tend to push the boundaries of safe speeds for the conditions too.