google / google/gvisor

Add getcpu() and improve clock_gettime in VDSO

Open
#3,101 0 comments 0 reactions 0 assignees View on GitHub
area: kernel status: help wanted type: enhancement
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

Current VDSO (implemented by sentry, and used by the real application) is a partial implimentation. More specifically, getcpu() is not implemented, and clock_gettime() only works for CLOCK_REALTIME, CLOCK_BOOTTIME, and CLOCK_MONOTONIC.

For example, we need to CLOCK_MONOTONIC_COARSE. Considering that it's just a less precise version of CLOCK_MONOTONIC, let's just use the implementation of CLOCK_MONOTONIC?

getcpu() could be very tricky. Linux uses [RDPID (Read Processor ID) instruction](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/segment.h#L266). But sentry maintains a set of virtual CPUs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.