Data Filtering, Deduplication and Reweighting for LLM Pre-Training