public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: vasily isaenko <vasily.isaenko@oracle.com>,
	ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH V2 2/3] syscalls/migrate_pages: fix nodemask memory allocation
Date: Wed, 21 Aug 2013 10:32:28 -0400 (EDT)	[thread overview]
Message-ID: <1585868915.1934407.1377095548829.JavaMail.root@redhat.com> (raw)
In-Reply-To: <1377086098-32691-2-git-send-email-stanislav.kholmanskikh@oracle.com>



----- Original Message -----
> From: "Stanislav Kholmanskikh" <stanislav.kholmanskikh@oracle.com>
> To: ltp-list@lists.sourceforge.net
> Cc: "vasily isaenko" <vasily.isaenko@oracle.com>, jstancek@redhat.com
> Sent: Wednesday, 21 August, 2013 1:54:57 PM
> Subject: [PATCH V2 2/3] syscalls/migrate_pages: fix nodemask memory allocation
> 
> In accordance to man migrate_pages(), mbind() the bit mask size
> should be rounded to next multiple of sizeof(unsigned long).
> 
> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>

As noted in 3/3 we need to align on bits, looks good to me.

Reviewed-by: Jan Stancek <jstancek@redhat.com>

> ---
>  .../syscalls/migrate_pages/migrate_pages01.c       |    2 +-
>  .../syscalls/migrate_pages/migrate_pages02.c       |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
> b/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
> index c23e8b0..6361e9f 100644
> --- a/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
> +++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
> @@ -248,7 +248,7 @@ static void setup(void)
>  			 ret);
>  
>  	sane_max_node = get_max_node();
> -	sane_nodemask_size = sane_max_node / 8 + 1;
> +	sane_nodemask_size = ALIGN(sane_max_node, sizeof(unsigned long)*8) / 8;
>  	sane_old_nodes = SAFE_MALLOC(NULL, sane_nodemask_size);
>  	sane_new_nodes = SAFE_MALLOC(NULL, sane_nodemask_size);
>  	memset(sane_old_nodes, 0, sane_nodemask_size);
> diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
> b/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
> index 49129e0..5790abd 100644
> --- a/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
> +++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
> @@ -110,7 +110,7 @@ static int migrate_to_node(pid_t pid, int node)
>  	tst_resm(TINFO, "pid(%d) migrate pid %d to node -> %d",
>  		 getpid(), pid, node);
>  	max_node = get_max_node();
> -	nodemask_size = max_node / 8 + 1;
> +	nodemask_size = ALIGN(max_node, sizeof(unsigned long)*8) / 8;
>  	old_nodes = SAFE_MALLOC(NULL, nodemask_size);
>  	new_nodes = SAFE_MALLOC(NULL, nodemask_size);
>  
> --
> 1.7.1
> 
> 

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-08-21 14:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <52122141.3020005@oracle.com>
2013-08-21 11:54 ` [LTP] [PATCH V2 1/3] Added ALIGN, __ALIGN_MASK macroses Stanislav Kholmanskikh
2013-08-21 11:54 ` [LTP] [PATCH V2 2/3] syscalls/migrate_pages: fix nodemask memory allocation Stanislav Kholmanskikh
2013-08-21 14:32   ` Jan Stancek [this message]
2013-08-21 11:54 ` [LTP] [PATCH V2 3/3] lib/numa_helper.c: fix nodemask_size Stanislav Kholmanskikh
2013-08-21 12:29   ` Jan Stancek
2013-08-21 13:22     ` Stanislav Kholmanskikh
2013-08-21 14:28       ` Jan Stancek
2013-08-22  6:13         ` Stanislav Kholmanskikh
2013-08-22  7:01           ` Jan Stancek
2013-08-22  7:41 ` [LTP] [PATCH V3 1/3] Added ALIGN, __ALIGN_MASK macroses Stanislav Kholmanskikh
2013-08-23  7:57   ` Jan Stancek
2013-08-23  8:26     ` [LTP] [PATCH V3.1 1/3] Added ALIGN, __ALIGN_MASK macros Stanislav Kholmanskikh
2013-08-27 12:01       ` chrubis
2013-08-23  8:28     ` [LTP] [PATCH V3 1/3] Added ALIGN, __ALIGN_MASK macroses Stanislav Kholmanskikh
2013-08-22  7:41 ` [LTP] [PATCH V3 2/3] syscalls/migrate_pages: fix nodemask memory allocation Stanislav Kholmanskikh
2013-08-27 12:04   ` chrubis
     [not found]     ` <1377607792-5731-1-git-send-email-stanislav.kholmanskikh@oracle.com>
2013-08-28 13:43       ` [LTP] [PATCH V4] syscalls/migrate_pages: fix nodemask_memory_allocation chrubis
2013-08-22  7:41 ` [LTP] [PATCH V3 3/3] lib/numa_helper.c: fix nodemask_size Stanislav Kholmanskikh

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=1585868915.1934407.1377095548829.JavaMail.root@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=stanislav.kholmanskikh@oracle.com \
    --cc=vasily.isaenko@oracle.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