All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Valentin Schneider <vschneid@redhat.com>
Cc: linux-rt-users@vger.kernel.org, Clark Williams <williams@redhat.com>
Subject: Re: [PATCH 2/3] rteval: kcompile: Fix offline node handling
Date: Fri, 29 Apr 2022 16:21:04 -0400 (EDT)	[thread overview]
Message-ID: <6ecdb475-953-081-c817-62d5e3647e8@redhat.com> (raw)
In-Reply-To: <20220419161443.89674-3-vschneid@redhat.com>



On Tue, 19 Apr 2022, Valentin Schneider wrote:

> Having an empty NumaNode but with CPUs attached to it (IOW they are all
> offline) causes kcompile.py to raise the following exception:
> 
>   calc_jobs_per_cpu():
>       ratio = float(mem) / float(len(self.node))
>   ZeroDivisionError: float division by zero
> 
> Remove nodes that do have CPUs but none of which are online.
> 
> Signed-off-by: Valentin Schneider <vschneid@redhat.com>
> ---
>  rteval/modules/loads/kcompile.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
> index 367f8dc..ac99964 100644
> --- a/rteval/modules/loads/kcompile.py
> +++ b/rteval/modules/loads/kcompile.py
> @@ -211,7 +211,10 @@ class Kcompile(CommandLineLoad):
>  
>          # remove nodes with no cpus available for running
>          for node, cpus in self.cpus.items():
> -            if not cpus:
> +            # If the intersection between the node CPUs and the cpulist is empty
> +            # then either the cpulist exludes that node, or the CPUs allowed by
> +            # the cpulist are actually offline
> +            if not set(self.topology.nodes[node].cpus.cpulist) & set(cpus):
>                  self.nodes.remove(node)
>                  self._log(Log.DEBUG, "node %s has no available cpus, removing" % node)
>  
> -- 
> 2.27.0
> 
> 

Sorry, this isn't quite right.

The cpulist in kcompile is the list of cpus where the load modules will 
run. The user can specify it like this
--loads-cpulist=LIST

If the user does not specify a list (because they want it to run 
everywhere) then the cpulist is empty. Your patch was working for you 
because the cpulist was empty, but that has nothing to do with whether the 
cpu is online or not.

systopology will fetch a list of cpus and consider whether they are online 
or not. So, I think the solution is to delete the method in kcompile and 
just use the one in systopology.

Sending another mail with the patch.

Thanks

John Kacur


  reply	other threads:[~2022-04-29 20:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 16:14 [PATCH 0/3] rteval: Offline NUMA node bugfix Valentin Schneider
2022-04-19 16:14 ` [PATCH 1/3] rteval: systopology: Fix offline NUMA node parsing Valentin Schneider
2022-04-29 19:54   ` John Kacur
2022-04-19 16:14 ` [PATCH 2/3] rteval: kcompile: Fix offline node handling Valentin Schneider
2022-04-29 20:21   ` John Kacur [this message]
2022-04-19 16:14 ` [PATCH 3/3] rteval: systopology: Slight CpuList.__expand_cpulist() cleanup Valentin Schneider
2022-04-29 20:53   ` John Kacur
2022-05-03 10:26     ` Valentin Schneider

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=6ecdb475-953-081-c817-62d5e3647e8@redhat.com \
    --to=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=vschneid@redhat.com \
    --cc=williams@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.