* [PATCH iproute2-next v2 0/2] Add copy-on-fork to get sys command
@ 2021-04-29 6:48 Gal Pressman
2021-04-29 6:48 ` [PATCH iproute2-next v2 1/2] rdma: update uapi headers Gal Pressman
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Gal Pressman @ 2021-04-29 6:48 UTC (permalink / raw)
To: David Ahern
Cc: linux-rdma, netdev, Yossi Leybovich, Alexander Matushevsky,
Leon Romanovsky, Jason Gunthorpe, Gal Pressman
This is the userspace part for the new copy-on-fork attribute added to
the get sys netlink command.
The new attribute indicates that the kernel copies DMA pages on fork,
hence fork support through madvise and MADV_DONTFORK is not needed.
Kernel series was merged:
https://lore.kernel.org/linux-rdma/20210418121025.66849-1-galpress@amazon.com/
Changelog -
v1->v2: https://lore.kernel.org/linux-rdma/20210428114231.96944-1-galpress@amazon.com/
* Rebase kernel headers
* Print attributes on the same line
* Simplify if statement
Thanks
Gal Pressman (2):
rdma: update uapi headers
rdma: Add copy-on-fork to get sys command
rdma/include/uapi/rdma/rdma_netlink.h | 3 +++
rdma/sys.c | 11 ++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
--
2.31.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH iproute2-next v2 1/2] rdma: update uapi headers
2021-04-29 6:48 [PATCH iproute2-next v2 0/2] Add copy-on-fork to get sys command Gal Pressman
@ 2021-04-29 6:48 ` Gal Pressman
2021-04-29 7:13 ` Leon Romanovsky
2021-04-29 6:48 ` [PATCH iproute2-next v2 2/2] rdma: Add copy-on-fork to get sys command Gal Pressman
2021-05-03 14:44 ` [PATCH iproute2-next v2 0/2] " David Ahern
2 siblings, 1 reply; 6+ messages in thread
From: Gal Pressman @ 2021-04-29 6:48 UTC (permalink / raw)
To: David Ahern
Cc: linux-rdma, netdev, Yossi Leybovich, Alexander Matushevsky,
Leon Romanovsky, Jason Gunthorpe, Gal Pressman
Update rdma_netlink.h file upto kernel commit
6cc9e215eb27 ("RDMA/nldev: Add copy-on-fork attribute to get sys command")
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
rdma/include/uapi/rdma/rdma_netlink.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index e161c245bf71..37f583ee58fc 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -546,6 +546,9 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_MIN_RANGE, /* u32 */
RDMA_NLDEV_ATTR_MAX_RANGE, /* u32 */
+
+ RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK, /* u8 */
+
/*
* Always the end
*/
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH iproute2-next v2 2/2] rdma: Add copy-on-fork to get sys command
2021-04-29 6:48 [PATCH iproute2-next v2 0/2] Add copy-on-fork to get sys command Gal Pressman
2021-04-29 6:48 ` [PATCH iproute2-next v2 1/2] rdma: update uapi headers Gal Pressman
@ 2021-04-29 6:48 ` Gal Pressman
2021-04-29 7:12 ` Leon Romanovsky
2021-05-03 14:44 ` [PATCH iproute2-next v2 0/2] " David Ahern
2 siblings, 1 reply; 6+ messages in thread
From: Gal Pressman @ 2021-04-29 6:48 UTC (permalink / raw)
To: David Ahern
Cc: linux-rdma, netdev, Yossi Leybovich, Alexander Matushevsky,
Leon Romanovsky, Jason Gunthorpe, Gal Pressman
The new attribute indicates that the kernel copies DMA pages on fork,
hence fork support through madvise and MADV_DONTFORK is not needed.
If the attribute is not reported (expected on older kernels),
copy-on-fork is disabled.
Example:
$ rdma sys
netns shared copy-on-fork on
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
rdma/sys.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/rdma/sys.c b/rdma/sys.c
index 8fb565d70598..fd785b253e20 100644
--- a/rdma/sys.c
+++ b/rdma/sys.c
@@ -20,6 +20,7 @@ static const char *netns_modes_str[] = {
static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data)
{
struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ bool cof = false;
mnl_attr_parse(nlh, 0, rd_attr_cb, tb);
@@ -35,9 +36,17 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data)
else
mode_str = "unknown";
- print_color_string(PRINT_ANY, COLOR_NONE, "netns", "netns %s\n",
+ print_color_string(PRINT_ANY, COLOR_NONE, "netns", "netns %s ",
mode_str);
}
+
+ if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK])
+ cof = mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]);
+
+ print_color_on_off(PRINT_ANY, COLOR_NONE, "copy-on-fork",
+ "copy-on-fork %s\n",
+ cof);
+
return MNL_CB_OK;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2-next v2 2/2] rdma: Add copy-on-fork to get sys command
2021-04-29 6:48 ` [PATCH iproute2-next v2 2/2] rdma: Add copy-on-fork to get sys command Gal Pressman
@ 2021-04-29 7:12 ` Leon Romanovsky
0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2021-04-29 7:12 UTC (permalink / raw)
To: Gal Pressman
Cc: David Ahern, linux-rdma, netdev, Yossi Leybovich,
Alexander Matushevsky, Jason Gunthorpe
On Thu, Apr 29, 2021 at 09:48:03AM +0300, Gal Pressman wrote:
> The new attribute indicates that the kernel copies DMA pages on fork,
> hence fork support through madvise and MADV_DONTFORK is not needed.
>
> If the attribute is not reported (expected on older kernels),
> copy-on-fork is disabled.
>
> Example:
> $ rdma sys
> netns shared copy-on-fork on
>
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
> rdma/sys.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
Thanks,
Acked-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2-next v2 1/2] rdma: update uapi headers
2021-04-29 6:48 ` [PATCH iproute2-next v2 1/2] rdma: update uapi headers Gal Pressman
@ 2021-04-29 7:13 ` Leon Romanovsky
0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2021-04-29 7:13 UTC (permalink / raw)
To: Gal Pressman
Cc: David Ahern, linux-rdma, netdev, Yossi Leybovich,
Alexander Matushevsky, Jason Gunthorpe
On Thu, Apr 29, 2021 at 09:48:02AM +0300, Gal Pressman wrote:
> Update rdma_netlink.h file upto kernel commit
> 6cc9e215eb27 ("RDMA/nldev: Add copy-on-fork attribute to get sys command")
>
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
> rdma/include/uapi/rdma/rdma_netlink.h | 3 +++
> 1 file changed, 3 insertions(+)
>
Thanks,
Acked-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2-next v2 0/2] Add copy-on-fork to get sys command
2021-04-29 6:48 [PATCH iproute2-next v2 0/2] Add copy-on-fork to get sys command Gal Pressman
2021-04-29 6:48 ` [PATCH iproute2-next v2 1/2] rdma: update uapi headers Gal Pressman
2021-04-29 6:48 ` [PATCH iproute2-next v2 2/2] rdma: Add copy-on-fork to get sys command Gal Pressman
@ 2021-05-03 14:44 ` David Ahern
2 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2021-05-03 14:44 UTC (permalink / raw)
To: Gal Pressman
Cc: linux-rdma, netdev, Yossi Leybovich, Alexander Matushevsky,
Leon Romanovsky, Jason Gunthorpe
On 4/29/21 12:48 AM, Gal Pressman wrote:
> This is the userspace part for the new copy-on-fork attribute added to
> the get sys netlink command.
>
> The new attribute indicates that the kernel copies DMA pages on fork,
> hence fork support through madvise and MADV_DONTFORK is not needed.
>
> Kernel series was merged:
> https://lore.kernel.org/linux-rdma/20210418121025.66849-1-galpress@amazon.com/
>
> Changelog -
> v1->v2: https://lore.kernel.org/linux-rdma/20210428114231.96944-1-galpress@amazon.com/
> * Rebase kernel headers
> * Print attributes on the same line
> * Simplify if statement
>
> Thanks
>
> Gal Pressman (2):
> rdma: update uapi headers
> rdma: Add copy-on-fork to get sys command
>
> rdma/include/uapi/rdma/rdma_netlink.h | 3 +++
> rdma/sys.c | 11 ++++++++++-
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
applied to iproute2-next
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-05-03 14:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 6:48 [PATCH iproute2-next v2 0/2] Add copy-on-fork to get sys command Gal Pressman
2021-04-29 6:48 ` [PATCH iproute2-next v2 1/2] rdma: update uapi headers Gal Pressman
2021-04-29 7:13 ` Leon Romanovsky
2021-04-29 6:48 ` [PATCH iproute2-next v2 2/2] rdma: Add copy-on-fork to get sys command Gal Pressman
2021-04-29 7:12 ` Leon Romanovsky
2021-05-03 14:44 ` [PATCH iproute2-next v2 0/2] " David Ahern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).