Re: [PATCH] vDSO for sparc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nagarathnam Muthusamy <nagarathnam.muthusamy@xxxxxxxxxx>
Date: Mon, 26 Jun 2017 12:39:27 -0400

> +static notrace inline u64
> +vgetsns(struct vvar_data *vvar)
> +{
> +	u64 v;
> +	u64 cycles;
> +
> +	switch (vvar->vclock_mode) {
> +	case VCLOCK_TICK:
> +		cycles = vread_tick();
> +		break;
> +	case VCLOCK_STICK:
> +		cycles = vread_stick();
> +		break;
> +	default:
> +		return 0;
> +	}
> +	v = (cycles - vvar->clock.cycle_last) & vvar->clock.mask;
> +	return v * vvar->clock.mult;
> +}

If you're going to go through all of this trouble to make a vdso,
it should be assembler code patched at boot time for the tick
access etc.

It is wasteful to run this switch statement when on a given
machine it will evaluate to the same value always.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux