netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gal Pressman <galpress@amazon.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: David Ahern <dsahern@gmail.com>, <linux-rdma@vger.kernel.org>,
	<netdev@vger.kernel.org>, Yossi Leybovich <sleybo@amazon.com>,
	Alexander Matushevsky <matua@amazon.com>,
	Jason Gunthorpe <jgg@nvidia.com>
Subject: Re: [PATCH iproute2-next 2/2] rdma: Add copy-on-fork to get sys command
Date: Thu, 29 Apr 2021 09:40:16 +0300	[thread overview]
Message-ID: <920dc792-dd72-f125-5546-fff9edb4b9a5@amazon.com> (raw)
In-Reply-To: <YIlObZNuu8TBxHLH@unreal>

On 28/04/2021 15:00, Leon Romanovsky wrote:
> On Wed, Apr 28, 2021 at 02:42:31PM +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
> 
> I don't think that we need to print them on separate lines.
> $ rdma sys
> netns shared copy-on-fork on

Ack.

>> Signed-off-by: Gal Pressman <galpress@amazon.com>
>> ---
>>  rdma/sys.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/rdma/sys.c b/rdma/sys.c
>> index 8fb565d70598..dd9c6da33e2a 100644
>> --- a/rdma/sys.c
>> +++ b/rdma/sys.c
>> @@ -38,6 +38,15 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data)
>>  		print_color_string(PRINT_ANY, COLOR_NONE, "netns", "netns %s\n",
>>  				   mode_str);
>>  	}
>> +
>> +	if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK])
>> +		print_color_on_off(PRINT_ANY, COLOR_NONE, "copy-on-fork",
>> +				   "copy-on-fork %s\n",
>> +				   mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]));
>> +	else
>> +		print_color_on_off(PRINT_ANY, COLOR_NONE, "copy-on-fork",
>> +				   "copy-on-fork %s\n", false);
> 
> Let's simplify it
>         bool cow = false;
> 
>  +	if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK])
>  +		cow = 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", cow);

Ack (changed cow -> cof).

Thanks

      reply	other threads:[~2021-04-29  6:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 11:42 [PATCH iproute2-next 0/2] Add copy-on-fork to get sys command Gal Pressman
2021-04-28 11:42 ` [PATCH iproute2-next 1/2] rdma: update uapi headers Gal Pressman
2021-04-28 11:42 ` [PATCH iproute2-next 2/2] rdma: Add copy-on-fork to get sys command Gal Pressman
2021-04-28 12:00   ` Leon Romanovsky
2021-04-29  6:40     ` Gal Pressman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=920dc792-dd72-f125-5546-fff9edb4b9a5@amazon.com \
    --to=galpress@amazon.com \
    --cc=dsahern@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matua@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=sleybo@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).