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 1/3] rteval: systopology: Fix offline NUMA node parsing
Date: Fri, 29 Apr 2022 15:54:12 -0400 (EDT)	[thread overview]
Message-ID: <16e1df7-d472-dabf-798f-e8e49d74b29@redhat.com> (raw)
In-Reply-To: <20220419161443.89674-2-vschneid@redhat.com>



On Tue, 19 Apr 2022, Valentin Schneider wrote:

> An offline NUMA node will report in its cpulist an empty
> string. Unfortunately, "".split(sep=x) with x != None returns a list
> containing an empty string rather than an empty list, which causes
> CpuList._expand_cpulist() to try to run int(''), which ends up in the
> following exception:
> 
>   ValueError: invalid literal for int() with base 10: ''
> 
> Prevent this by adding an early empty-string check.
> 
> Signed-off-by: Valentin Schneider <vschneid@redhat.com>
> ---
>  rteval/systopology.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/rteval/systopology.py b/rteval/systopology.py
> index bf794ce..b2da7bb 100644
> --- a/rteval/systopology.py
> +++ b/rteval/systopology.py
> @@ -103,6 +103,10 @@ class CpuList:
>          don't error check against online cpus
>          """
>          result = []
> +
> +        if not cpulist:
> +            return result
> +
>          for part in cpulist.split(','):
>              if '-' in part:
>                  a, b = part.split('-')
> -- 
> 2.27.0
> 
> 
Signed-off-by: John Kacur <jkacur@redhat.com>


  reply	other threads:[~2022-04-29 19:54 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 [this message]
2022-04-19 16:14 ` [PATCH 2/3] rteval: kcompile: Fix offline node handling Valentin Schneider
2022-04-29 20:21   ` John Kacur
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=16e1df7-d472-dabf-798f-e8e49d74b29@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.