For example, does a Barbarian 10/Pain Taster 2 have DR 3/— or DR 2/—?
Yes. As covered in this question, DR from different sources in Pathfinder does not normally stack. However, DR/- from Pain Taster explicitly stacks with DR/- provided by levels in other classes. From the Pain Taster's DR ability description:
This ability stacks with any other damage reduction the pain taster might already have from other classes.
So DR2/- provided by the barbarian's class features, plus DR1/- provided by the Pain Taster, is effectively DR3/- in total, and so on.
The original title of the question referenced nonlethal damage. This is presumably because the Pain Taster's DR ability has following special case:
The value of this damage reduction doubles when the pain taster is subject to nonlethal damage.
In this case the DR provided by the Pain Taster's ability is doubled versus nonlethal damage, but not the DR provided by other classes. A Barbarian 10/Pain Taster 2 would have DR3/- normally (2 from barbarian, 1 from Pain Taster) but DR4/- against nonlethal damage (2 from barbarian, 2 from Pain Taster).