public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Attila Fazekas <afazekas@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/2] lib: move get_numcpus to librttest.[ch]
Date: Fri, 17 Jan 2025 17:17:40 +0100	[thread overview]
Message-ID: <Z4qCpIiCZHME7r_e@yuki.lan> (raw)
In-Reply-To: <20250117135745.909549-2-afazekas@redhat.com>

Hi!
> +int get_numcpus(void)
> +{
> +	long numcpus_conf = sysconf(_SC_NPROCESSORS_CONF);
> +	size_t size = CPU_ALLOC_SIZE(numcpus_conf);
> +	cpu_set_t *cpuset = CPU_ALLOC(numcpus_conf);
> +
> +	CPU_ZERO_S(size, cpuset);
> +	/* Get the number of cpus accessible to the current process */
> +	sched_getaffinity(0, size, cpuset);
> +
> +	return CPU_COUNT_S(size, cpuset);
> +}

Can we please add another patch on the top that adds CPU_FREE() to this
function?

For this patch:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-01-17 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-17 13:57 [LTP] [PATCH v2 0/2] sched_football: isolcpus handling Attila Fazekas
2025-01-17 13:57 ` [LTP] [PATCH v2 1/2] lib: move get_numcpus to librttest.[ch] Attila Fazekas
2025-01-17 16:17   ` Cyril Hrubis [this message]
2025-01-17 13:57 ` [LTP] [PATCH v2 2/2] sched_football: use get_numcpus() Attila Fazekas
2025-01-17 16:18   ` Cyril Hrubis
2025-01-21  9:15     ` Petr Vorel
2025-01-23 11:21       ` Attila Fazekas

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=Z4qCpIiCZHME7r_e@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=afazekas@redhat.com \
    --cc=ltp@lists.linux.it \
    /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