public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Zhouping Liu <zliu@redhat.com>
To: Jan Stancek <jstancek@redhat.com>
Cc: LTP List <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH v2 3/7] numa_helper: added a new function is_numa()
Date: Sun, 17 Mar 2013 22:33:58 -0400 (EDT)	[thread overview]
Message-ID: <1167919494.9250965.1363574038668.JavaMail.root@redhat.com> (raw)
In-Reply-To: <1555759857.19404682.1363363797191.JavaMail.root@redhat.com>



----- Original Message -----
> From: "Jan Stancek" <jstancek@redhat.com>
> To: "Zhouping Liu" <zliu@redhat.com>
> Cc: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Saturday, March 16, 2013 12:09:57 AM
> Subject: Re: [LTP] [PATCH v2 3/7] numa_helper: added a new function is_numa()
> 
> 
> 
> ----- Original Message -----
> > From: "Zhouping Liu" <zliu@redhat.com>
> > To: "LTP List" <ltp-list@lists.sourceforge.net>
> > Sent: Friday, 15 March, 2013 4:03:08 PM
> > Subject: [LTP] [PATCH v2 3/7] numa_helper: added a new function
> > is_numa()
> > 
> > Added a new function is_numa(), which is desinged to judge
> > whether a system contains more than 1 available numa nodes
> > or not, and lots of cases need it.
> > 
> > Signed-off-by: Zhouping Liu <zliu@redhat.com>
> > ---
> >  testcases/kernel/include/numa_helper.h |  1 +
> >  testcases/kernel/lib/numa_helper.c     | 25
> >  +++++++++++++++++++++++++
> >  2 files changed, 26 insertions(+)
> > 
> > diff --git a/testcases/kernel/include/numa_helper.h
> > b/testcases/kernel/include/numa_helper.h
> > index 8e82d7b..251fd54 100644
> > --- a/testcases/kernel/include/numa_helper.h
> > +++ b/testcases/kernel/include/numa_helper.h
> > @@ -34,5 +34,6 @@ unsigned long get_max_node(void);
> >  int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
> >  int get_allowed_nodes(int flag, int count, ...);
> >  void nh_dump_nodes();
> > +int is_numa(void (*cleanup_fn)(void));
> >  
> >  #endif
> > diff --git a/testcases/kernel/lib/numa_helper.c
> > b/testcases/kernel/lib/numa_helper.c
> > index 4ab8e3c..f9a4c3a 100644
> > --- a/testcases/kernel/lib/numa_helper.c
> > +++ b/testcases/kernel/lib/numa_helper.c
> > @@ -265,3 +265,28 @@ void nh_dump_nodes()
> >  	print_node_info(NH_CPUS);
> >  	print_node_info(NH_MEMS | NH_CPUS);
> >  }
> > +
> > +/*
> > + * is_numa - judge a system is NUMA system or not
> > + * NOTE: the function is designed to try to find more than
> > + *       1 available node, at least each node contains memory.
> > + * WARN: Don't use this func in child, as it calls tst_brkm()
> > + * RETURNS:
> > + *     0 - it's not a NUMA system
> > + *     1 - it's a NUMA system
> > + */
> > +int is_numa(void (*cleanup_fn)(void))
> > +{
> > +	int ret;
> > +	int numa_nodes = 0;
> > +	int *nodes = NULL;
> > +
> > +	ret = get_allowed_nodes_arr(NH_MEMS, &numa_nodes, &nodes);
> 
> If you don't need node ids, you can pass NULL:
>         ret = get_allowed_nodes_arr(NH_MEMS, &numa_nodes, NULL);
> Otherwise you should free 'nodes' variable.

OK, I will free 'nodes' variable in V3.

-- 
Thanks,
Zhouping

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-03-18  2:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 15:03 [LTP] [PATCH v2 0/7] mm/oom: extend the coverage of OOM Zhouping Liu
2013-03-15 15:03 ` [LTP] [PATCH v2 1/7] lib/mem: modified _gather_cpus() as _gather_node_cpus() Zhouping Liu
2013-03-15 15:03 ` [LTP] [PATCH v2 2/7] mm/oom02: modified 'OOM for NUMA' as 'OOM for mempolicy' Zhouping Liu
2013-03-15 15:03 ` [LTP] [PATCH v2 3/7] numa_helper: added a new function is_numa() Zhouping Liu
2013-03-15 16:09   ` Jan Stancek
2013-03-18  2:33     ` Zhouping Liu [this message]
2013-03-15 15:03 ` [LTP] [PATCH v2 4/7] mm/oom0[3|4]: added 'OOM for CPUSET' and moved 'OOM with MEMCG & numa' to oom03 Zhouping Liu
2013-03-15 15:03 ` [LTP] [PATCH v2 5/7] lib/mem: updated testoom() and oom() funcs Zhouping Liu
2013-03-15 15:03 ` [LTP] [PATCH v2 6/7] mm/oom05: new testcase Zhouping Liu
2013-03-15 15:03 ` [LTP] [PATCH v2 7/7] lib/mem: removed the prefix underscore '_' of the internal function name Zhouping Liu

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=1167919494.9250965.1363574038668.JavaMail.root@redhat.com \
    --to=zliu@redhat.com \
    --cc=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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