public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Jan Stancek <jstancek@redhat.com>
Cc: LTP List <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH 3/5] mm/oom0[3|4]: added 'OOM for CPUSET' and updated 'OOM with MEMCG & numa'
Date: Thu, 14 Mar 2013 19:32:33 +0100	[thread overview]
Message-ID: <20130314183233.GF8894@rei.suse.cz> (raw)
In-Reply-To: <507561236.18941341.1363282016883.JavaMail.root@redhat.com>

Hi!
> We added numa_helper library to be able to get number of nodes, as well
> as list of nodes (with memory, cpu or both). numa_max_node() > 0 doesn't
> tell you how many nodes you have.
> 
> Here's sample use to get just node count:
> ----------------------------------------------------------------
> #include <stdio.h>
> #include "numa_helper.h"
> 
> const char *TCID="test";
> int main()
> {
>         int num_nodes;
>         int ret = get_allowed_nodes_arr(NH_MEMS | NH_CPUS, &num_nodes, NULL);
>         printf("ret: %d, nodes:%d\n", ret, num_nodes);
>         return 0;
> }
> ----------------------------------------------------------------
> 
> We could add a simple function to numa_helper, but I'm not sure what
> it would return as default, some tests care about nodes with memory.

Maybe we misunderstand about what I see as a problem here. This patch
adds integer variable to the lib/mem.c library and that variable is then
only used within the tests. That just looks like wrong desing to me.

The code snippet "numa_max_node() > 0" was take from one of the tests
that initializes the variable in question (the pattern seems to repeat
in them). So I wasn't proposing any functional changes in the code just
requesting cleaner desing.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
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

  parent reply	other threads:[~2013-03-14 18:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 16:21 [LTP] [PATCH 0/5] mm/oom: extend the coverage of OOM Zhouping Liu
2013-03-14 16:21 ` [LTP] [PATCH 1/5] lib/mem: modified _gather_cpus() as _gather_node_cpus() Zhouping Liu
2013-03-14 16:45   ` chrubis
2013-03-14 16:21 ` [LTP] [PATCH 2/5] mm/oom02: modified 'OOM for NUMA' as 'OOM for mempolicy' Zhouping Liu
2013-03-15  3:09   ` Caspar Zhang
2013-03-15  3:57     ` Zhouping Liu
2013-03-15  4:33       ` Caspar Zhang
2013-03-14 16:21 ` [LTP] [PATCH 3/5] mm/oom0[3|4]: added 'OOM for CPUSET' and updated 'OOM with MEMCG & numa' Zhouping Liu
2013-03-14 16:51   ` chrubis
     [not found]     ` <507561236.18941341.1363282016883.JavaMail.root@redhat.com>
2013-03-14 18:32       ` chrubis [this message]
2013-03-14 16:21 ` [LTP] [PATCH 4/5] lib/mem: updated testoom() and oom() funcs Zhouping Liu
2013-03-14 16:21 ` [LTP] [PATCH 5/5] mm/oom05: new testcase Zhouping Liu
     [not found] <51428CEA.6030604@redhat.com>
2013-03-15  9:11 ` [LTP] [PATCH 3/5] mm/oom0[3|4]: added 'OOM for CPUSET' and updated 'OOM with MEMCG & numa' Jan Stancek
2013-03-15 15:41   ` Zhouping Liu
2013-03-15 16:06     ` Jan Stancek

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=20130314183233.GF8894@rei.suse.cz \
    --to=chrubis@suse.cz \
    --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