Re: [PATCH v3] userfaultfd: provide pid in userfault msg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Alexey,

v3 looks great to me.

Reviewed-by: Andrea Arcangeli <aarcange@xxxxxxxxxx>

On top of v3 I think we could add this to make it more obvious to the
developer tpid isn't necessarily there by just looking at the data
structure.

This is purely cosmetical, so feel free to comment if you
disagree.

I'm also fine to add an anonymous union later if a new usage for those
bytes emerges (ABI side doesn't change anything which is why this
could be done later as well, only the API changes here but then I
doubt we'd break the API later for this, so if we want pagefault.feat.*
it probably should be done right now).

Thanks,
Andrea

>From 901951f5a0456aa07d4fb1231cf2b1d352beb36f Mon Sep 17 00:00:00 2001
From: Andrea Arcangeli <aarcange@xxxxxxxxxx>
Date: Tue, 4 Apr 2017 20:50:54 +0200
Subject: [PATCH 1/1] userfaultfd: provide pid in userfault msg - add feat
 union

No ABI change, but this will make it more explicit to software that
ptid is only available if requested by passing UFFD_FEATURE_THREAD_ID
to UFFDIO_API. The fact it's a union will also self document it
shouldn't be taken for granted there's a tpid there.

Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx>
---
 include/uapi/linux/userfaultfd.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h
index ff8d0d2..524b860 100644
--- a/include/uapi/linux/userfaultfd.h
+++ b/include/uapi/linux/userfaultfd.h
@@ -84,7 +84,9 @@ struct uffd_msg {
 		struct {
 			__u64	flags;
 			__u64	address;
-			__u32   ptid;
+			union {
+				__u32 ptid;
+			} feat;
 		} pagefault;
 
 		struct {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux