Skip to content

habanalabs: support info queries by multiple processes

Oded Gabbay lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 2 repliesIn review
  2. v27 patches 2 repliesSuperseded
  3. v19 patches 6 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7habanalabs: add handle field to context structuredrivers/misc/habanalabs/context.c drivers/misc/habanalabs/habanalabs.h+18 -110 replies
2/7habanalabs: kill user process after CS rollbackdrivers/misc/habanalabs/device.c+13 -40 replies
3/7habanalabs: show the process context dram usagedrivers/misc/habanalabs/habanalabs_ioctl.c+7 -40 replies
4/7habanalabs: rename user_ctx as compute_ctxdrivers/misc/habanalabs/context.c drivers/misc/habanalabs/debugfs.c drivers/misc/habanalabs/device.c +1 more+21 -190 replies
5/7habanalabs: maintain a list of file private data objectsdrivers/misc/habanalabs/device.c drivers/misc/habanalabs/goya/goya_hwmgr.c drivers/misc/habanalabs/habanalabs.h +1 more+127 -1320 replies
6/7habanalabs: change device_setup_cdev() to be more genericdrivers/misc/habanalabs/device.c+25 -220 replies
7/7habanalabs: create two char devices per ASICdrivers/misc/habanalabs/device.c drivers/misc/habanalabs/habanalabs.h drivers/misc/habanalabs/habanalabs_drv.c +1 more+199 -521 reply

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchGreg Kroah-Hartman
SeriesR-b
1/7
2/7
3/7
4/7
5/7
6/7
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/7] habanalabs: support info queries by multiple processes

v3 introduces a few fixes and changes the control char device's minor number to be 1 above that of the main device.

Original text:

Today, the driver allows only a single user application (the deep-learning application) to perform queries of the device's stats, information, idle state and more.

This is a serious limitation in data centers, where there are multiple system/monitorining applications that want to continuously retrieve that information, while allowing the deep-learning application to perform work on the device.

This patch-set allows unlimited number of user applications to perform the above queries (by calling the INFO IOCTL), while the deep-learning application is running.

This is done by creating an additional char device per ASIC, that is dedicated to information retrieval only (allows only to call the INFO IOCTL). This method will maintain backward compatibility with existing userspace applications.

- Patches 1-4 makes small improvements to existing code.
- Patch 5 removes the accounting of the number of open file-descriptors and replace it with tracking of the driver's internal file private data strcuture.
- Patch 6 is a pre-requisite to creating the two char devices
- Patch 7 introduce the additional char device

Thanks,
Oded

Oded Gabbay (7):
habanalabs: add handle field to context structure
habanalabs: kill user process after CS rollback
habanalabs: show the process context dram usage
habanalabs: rename user_ctx as compute_ctx
habanalabs: maintain a list of file private data objects
habanalabs: change device_setup_cdev() to be more generic
habanalabs: create two char devices per ASIC

 drivers/misc/habanalabs/context.c          |  38 +--
 drivers/misc/habanalabs/debugfs.c          |   4 +-
 drivers/misc/habanalabs/device.c           | 255 ++++++++++++---------
 drivers/misc/habanalabs/goya/goya_hwmgr.c  |  25 +-
 drivers/misc/habanalabs/habanalabs.h       |  49 ++--
 drivers/misc/habanalabs/habanalabs_drv.c   | 165 ++++++++-----
 drivers/misc/habanalabs/habanalabs_ioctl.c | 104 ++++++---
 7 files changed, 403 insertions(+), 237 deletions(-)
Signature · 1 line
2.17.1