[PATCH v3 06/29] selftests/resctrl: Refactor fill_buf functions