If the MSG_ZEROCOPY flag is specified with rds_sendmsg(), and, if the SO_ZEROCOPY socket option has been set on the PF_RDS socket, application pages sent down with rds_sendmsg() are pinned. The pinning uses the accounting infrastructure added by Commit a91dbff551a6 ("sock: ulimit on MSG_ZEROCOPY pages") The payload bytes in the message may not be modified for the duration that the message has been pinned. A multi-threaded application using this infrastructure may thus need to be notified about send-completion so that it can free/reuse the buffers passed to rds_sendmsg(). Notification of send-completion will identify each message-buffer by a cookie that the application must specify as ancillary data to rds_sendmsg(). The ancillary data in this case has cmsg_level == SOL_RDS and cmsg_type == RDS_CMSG_ZCOPY_COOKIE.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -103,6 +103,7 @@ · 102 unmodified lines | ||
| 103 | 103 | #define RDS_CMSG_MASKED_ATOMIC_FADD 8 |
| 104 | 104 | #define RDS_CMSG_MASKED_ATOMIC_CSWP 9 |
| 105 | 105 | #define RDS_CMSG_RXPATH_LATENCY 11 |
| 106 | +#define RDS_CMSG_ZCOPY_COOKIE 12 | |
| 106 | 107 | |
| 107 | 108 | #define RDS_INFO_FIRST 10000 |
| 108 | 109 | #define RDS_INFO_COUNTERS 10000 |