All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Simon Derr <Simon.Derr@bull.net>, linux-kernel@vger.kernel.org
Subject: Re: (1/4) [PATCH] cpuset -- 2.6.0-test8
Date: Tue, 21 Oct 2003 17:08:08 -0700	[thread overview]
Message-ID: <20031022000808.GA14431@holomorphy.com> (raw)
In-Reply-To: <20031021162019.7089cee4.shemminger@osdl.org>

On Tue, Oct 21, 2003 at 04:20:19PM -0700, Stephen Hemminger wrote:
> +static const int N = (8*sizeof(cpumask_t));
> +/* mask must NOT be ZERO ! */
> +/* this is a cyclic version of next_cpu */
> +static inline void _next_cpu(const cpumask_t mask, int * index)
> +{
> +	for(;;) {
> +		if (++*index >= N) *index = 0;
> +		if (cpu_isset(*index, mask)) return;
> +	}
> +}

Best not to insist NR_CPUS % BITS_PER_LONG == 0.


On Tue, Oct 21, 2003 at 04:20:19PM -0700, Stephen Hemminger wrote:
> +/* When a cpuset with attached processes is being realloc'ed CPUs
> + * update the processes' masks and migrate them
> + */
> +static void migrate_cpuset_processes(struct cpuset * cs)
> +{		
> +	struct task_struct *g, *p;
> +	/* This should be a RARE use of the cpusets.
> +	 * therefore we'll prefer an inefficient operation here
> +	 * (searching the whole process list)
> +	 * than adding another list_head in task_t
> +	 * and locks and list_add for each fork()
> +	 */

Unfair rwlocks can take boxen out when abused by quadratic algorithms.


-- wli

  reply	other threads:[~2003-10-22  0:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-13 13:07 [RFC] cpuset proposal Simon Derr
2003-10-21 23:20 ` (1/4) [PATCH] cpuset -- 2.6.0-test8 Stephen Hemminger
2003-10-22  0:08   ` William Lee Irwin III [this message]
2003-10-22 14:34     ` Simon Derr
2003-10-22 14:57       ` William Lee Irwin III
2003-10-21 23:20 ` (2/4) [PATCH] cpuset - Kconfig Stephen Hemminger
2003-10-21 23:20 ` (3/4) [PATCH] cpuset - build without CPUSET configured Stephen Hemminger
2003-10-21 23:20 ` (4/4) [PATCH] cpuset -- seqfile change Stephen Hemminger

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=20031022000808.GA14431@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=Simon.Derr@bull.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@osdl.org \
    /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.