public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
Cc: yosefe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH libibverbs] Allow use of huge pages in multiple calls to ibv_fork_init
Date: Wed, 2 Mar 2016 21:44:38 -0500	[thread overview]
Message-ID: <56D7A516.5090707@redhat.com> (raw)
In-Reply-To: <1454499762-29819-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1600 bytes --]

On 2/3/2016 6:42 AM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Setting the environment variable RDMAV_HUGEPAGES_SAFE tells the library
> to check the underlying page size used by the kernel for memory regions.
> This is required if an application uses huge pages either directly or
> indirectly via a library such as libhugetlbfs.
> 
> The check of this variable was performed at the first call to
> ibv_fork_init. This caused to unpredicted behavior in complex
> applications with multiple underlying libraries.
> 
> The proposed change will allow support of huge pages without relying on
> ibv_fork_init calls order.

Thanks, applied.

> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  src/memory.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/src/memory.c b/src/memory.c
> index e9d1eecd9eab..89509c6e356f 100644
> --- a/src/memory.c
> +++ b/src/memory.c
> @@ -140,6 +140,9 @@ int ibv_fork_init(void)
>  	int ret;
>  	unsigned long size;
>  
> +	if (getenv("RDMAV_HUGEPAGES_SAFE"))
> +		huge_page_enabled = 1;
> +
>  	if (mm_root)
>  		return 0;
>  
> @@ -153,11 +156,6 @@ int ibv_fork_init(void)
>  	if (posix_memalign(&tmp, page_size, page_size))
>  		return ENOMEM;
>  
> -	if (getenv("RDMAV_HUGEPAGES_SAFE"))
> -		huge_page_enabled = 1;
> -	else
> -		huge_page_enabled = 0;
> -
>  	if (huge_page_enabled) {
>  		size = get_page_size(tmp);
>  		tmp_aligned = (void *) ((uintptr_t) tmp & ~(size - 1));
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

      parent reply	other threads:[~2016-03-03  2:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 11:42 [PATCH libibverbs] Allow use of huge pages in multiple calls to ibv_fork_init Leon Romanovsky
     [not found] ` <1454499762-29819-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2016-03-03  2:44   ` Doug Ledford [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=56D7A516.5090707@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=leon-2ukJVAZIZ/Y@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yosefe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /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