Thread (10 messages) 10 messages, 4 authors, 2017-11-27

Re: [PATCH] cxl: Add support for ASB_Notify on POWER9

From: Vaibhav Jain <hidden>
Date: 2017-11-23 14:16:13

Hi Christophe,

Few review comments:

Christophe Lombard [off-list ref] writes:
+
+int cxl_context_thread_tidr(struct cxl_context *ctx, int assign)
+{
+	int rc = 0;
+
+	/* Clear any TIDR value assigned to the current thread */
+	if (!assign) {
+		clear_thread_tidr(current);
+		ctx->tid = 0;
+	} else {
+		/* Assign a unique TIDR (thread id) for the current thread */
+		rc = set_thread_tidr(current);
+		if (!rc)
+			ctx->tid = current->thread.tidr;
set_thread_tidr can also return non-zero error values and will never
return '0'. So this condition should be 'if(rc > 0)' instead of 'if (!rc)'
+#define CXL_IOCTL_GET_AFU_ID		_IOR(CXL_MAGIC, 0x02, struct cxl_afu_id)
+#define CXL_IOCTL_THREAD_TIDR		_IOR(CXL_MAGIC, 0x03,
int)
Instead of adding a new syscall I think assiging a thread-id can be
better done by adding a new flag to the cxl_ioctl_start_work.flag
field and using one of the reserved fields to return the allocated tid
back to the user.

-- 
Vaibhav Jain [off-list ref]
Linux Technology Center, IBM India Pvt. Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help