As I understand it you can offset all capital gains in the same year and use up to $3,000 to offset ordinary income. Everything else in excess can be used in future year's gains or income.
Seems like a pretty powerful tax avoidance tool, I just haven't done it yet as my brokerage is still...