Quickest way (without multiplication) is divide and conquer, just like the usual bit popcount:
static inline int f(const u64 m)
{
const u64 ones = 0x0101010101010101ULL;
const u64 b64 = m & ones;
const u32 b32 = b64 + (b64>>32);
const u16 b16 = b32 + (b32>>16);
const u8 b8 = b16 + (b16>> 8);
return b8;
}