---
name: "work_on_cpu"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/work_on_cpu"
---

# work\_on\_cpu(9)

run a function in user context on a particular cpu

## NAME

work\_on\_cpu - run a function in user context on a particular cpu

## SYNOPSIS

**long work\_on\_cpu(int** *cpu***, long (\****fn***) (void \*), void \*** *arg***);**

## ARGUMENTS

*cpu*

the cpu to run on

*fn*

the function to run

*arg*

the function arg

## DESCRIPTION

It is up to the caller to ensure that the cpu doesn't go offline. The caller must not hold any locks which would prevent *fn* from completing.

## RETURN

The value *fn* returns.

## COPYRIGHT
