Re: [PATCH v6 12/17] powerpc/pseries/vas: Integrate API with open/close windows
flat view
From: Haren Myneni <haren@linux.ibm.com>
Date: 2021-06-18 07:50:01
Also in:
linux-crypto
On Fri, 2021-06-18 at 09:22 +1000, Nicholas Piggin wrote:
Excerpts from Haren Myneni's message of June 18, 2021 6:36 am:quoted
This patch adds VAS window allocatioa/close with the corresponding hcalls. Also changes to integrate with the existing user space VAS API and provide register/unregister functions to NX pseries driver. The driver register function is used to create the user space interface (/dev/crypto/nx-gzip) and unregister to remove this entry. The user space process opens this device node and makes an ioctl to allocate VAS window. The close interface is used to deallocate window. Signed-off-by: Haren Myneni <haren@linux.ibm.com>Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Unless there is some significant performance reason it might be simplest to take the mutex for the duration of the allocate and frees rather than taking it several times, covering the atomic with the lock instead. You have a big lock, might as well use it and not have to wonder what if things race here or there.
Using mutex to protect allocate/deallocate window and setup/free IRQ, also to protect updating the list. We do not need lock for modify window hcall and other things. Hence taking mutex several times. Also used atomic for counters (used_lpar_creds) which can be exported in sysfs (this patch will be added later in next enhancement seris). Genarlly applications open window initially, do continuous copy/paste operations and close window later. But possible that the library / application to open/close window for each request. Also may be opening or closing multiple windows (say 1000 depends on cores on the system) at the same time. These cases may affect the application performance. Thanks Haren
But don't rework that now, maybe just something to consider for later. Thanks, Nick