habanalabs/gaudi: monitor device memory usage
authorOded Gabbay <ogabbay@kernel.org>
Sun, 18 Oct 2020 12:32:23 +0000 (15:32 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 30 Nov 2020 08:47:30 +0000 (10:47 +0200)
commit3e6229965763129da2105f61cd4e0570ba53cb2b
treeca7f6d6ae2145f18d03d08bc05b1aae4c3d2c5b9
parent5de406c0b5c747c40277861ecf204ebfa095caa5
habanalabs/gaudi: monitor device memory usage

In GAUDI we don't have an MMU towards the HBM device memory. Therefore,
the user access that memory directly through physical address (via the
different engines) without the need to go through the driver to
allocate/free memory on the HBM.

For system monitoring purposes, the driver will keep track of the HBM
usage. This can be done as long as the user accurately reports the
allocations and releases of HBM memory, through the existing MEMORY
IOCTL uapi.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/memory.c