public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Glauber <glauber@gmx.de>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: Linux Architecture List <linux-arch@vger.kernel.org>
Subject: Re: [Patch] SMP call function cleanup
Date: Thu, 22 Apr 2004 16:15:25 +0200	[thread overview]
Message-ID: <1082643325.1332.66.camel@halo> (raw)
In-Reply-To: <1082642332.1778.39.camel@mulgrave>

On Thu, 2004-04-22 at 15:58, James Bottomley wrote:
> Because to execute on a single cpu it's less efficient than the single
> cpu variant (even with the sparse mask traversal) and the
> smp_call_functions are usually in the critical path, so saving cycles is
> good...

With my patch you would use on_single_cpu:

static inline void on_single_cpu(void (*func) (void *info), void *info,
                                 int nonatomic, int wait, int cpu)
{
        cpumask_t map;

        preempt_disable();
        cpus_clear(map);
        cpu_set(cpu, map);
        on_cpu(func, info, nonatomic, wait, map);
        preempt_enable();
}

so the overhead to the single cpu variant of smp_call_function is 

	cpus_clear(map);
	cpu_set(cpu, map);

on_cpu():
	cpus_and(map, map, cpu_online_map);
	if (cpus_empty(map))
		goto out;

and the for_each loop in on_cpu

I don't know if that overhead is so much that you want to have two smp
call functions.

Jan

---
Jan Glauber
Linux on zSeries Development
IBM Deutschland Entwicklung GmbH
Phone: +49 7031 161911   Mail: jang@de.ibm.com

  parent reply	other threads:[~2004-04-22 14:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-22 12:21 [Patch] SMP call function cleanup Jan Glauber
2004-04-22 12:28 ` William Lee Irwin III
2004-04-22 12:37   ` Anton Blanchard
2004-04-22 12:49     ` William Lee Irwin III
2004-04-22 12:59     ` James Bottomley
2004-04-22 13:24       ` William Lee Irwin III
2004-04-22 13:46         ` James Bottomley
2004-04-22 14:06           ` William Lee Irwin III
     [not found]       ` <1082641822.1329.45.camel@halo>
     [not found]         ` <1082642332.1778.39.camel@mulgrave>
2004-04-22 14:15           ` Jan Glauber [this message]
2004-04-23  0:05     ` Benjamin Herrenschmidt
2004-04-23  0:21       ` Anton Blanchard
2004-04-23  0:32         ` Benjamin Herrenschmidt
2004-04-22 13:58   ` Jan Glauber
2004-04-22 12:33 ` Anton Blanchard
2004-04-22 14:00   ` Jan Glauber
2004-04-22 14:13     ` William Lee Irwin III
2004-04-23  0:04 ` Benjamin Herrenschmidt
2004-04-23 23:38 ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2004-04-23  6:46 Martin Schwidefsky
2004-04-23  6:53 Martin Schwidefsky
2004-04-23  7:05 ` Anton Blanchard
2004-04-23  9:00   ` Russell King
2004-04-23  7:46 Martin Schwidefsky

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=1082643325.1332.66.camel@halo \
    --to=glauber@gmx.de \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-arch@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox