public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, npiggin@suse.de, paulus@samba.org,
	tglx@linutronix.de, mingo@redhat.com, tony.luck@intel.com
Subject: Re: [PATCH 0/5] Generic smp_call_function(), improvements, and  smp_call_function_single()
Date: Tue, 25 Mar 2008 19:00:25 +1100	[thread overview]
Message-ID: <200803251900.26154.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <20080321131558.GA15355@kernel.dk>

On Saturday 22 March 2008 00:15, Jens Axboe wrote:
> On Fri, Mar 21 2008, Ingo Molnar wrote:
> > * Jens Axboe <jens.axboe@oracle.com> wrote:
> > > The patch series is also available in the 'generic-ipi' branch from
> > >
> > > git://git.kernel.dk/linux-2.6-block.git
> > >
> > > and the 'io-cpu-affinity' branch is directly based on this.
> >
> > i'm still wondering about the following fundamental bit: why not use
> > per CPU kernel threads? That way you get a fast (lockless) IPI "for
> > free" as SMP wakeups already do this.
>
> The kernel thread variant wont be any more lockless than the
> smp_call_function_single() approach, they both have to grab the
> destination queue lock. If you recall, I pushed forward on the kernel
> thread variant and even still have it online here:
>
> http://git.kernel.dk/?p=linux-2.6-block.git;a=shortlog;h=io-cpu-affinity-kt
>hread
>
> which is pretty much identical to io-cpu-affinity, except it uses kernel
> threads for completion.
>
> The reason why I dropped the kthread approach is that it was slower.
> Time from signal to run was about 33% faster with IPI than with
> wake_up_process(). Doing benchmark runs, and the IPI approach won hands
> down in cache misses as well.

It's obviously going to be faster. The kthread approach needs an IPI
*and* a context switch on the destination CPU.

For broadcast situations, it is also going to be faster, because it
can use platform specific broadcast IPIs 

The only weird atomicity requirements of smp_call_function is due to
its terribly unscalable design. Once you have the producer provide its
own data (or accept -ENOMEM failures), then there is no problem. It's
then even possible to use it from interrupt context with not too much
more work.


> > smp_call_function() is quirky and has deep limitations on atomicity,
> > etc., so we are moving away from it and should not base more
> > functionality on it.
>
> The patchset does not build on smp_call_function(), it merely cleans
> that stuff up instead of having essentially the same code in each arch.
> As more archs are converted, it'll remove lots more code.

Also there is nothing wrong with improving the speed of the existing
implementation. The current smp_call_function is more or less unusable
for any real work because it is totally serialised.

Thanks for taking this patchset under your wing, Jens.


  reply	other threads:[~2008-03-25  8:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 11:56 [PATCH 0/5] Generic smp_call_function(), improvements, and smp_call_function_single() Jens Axboe
2008-03-19 11:56 ` [PATCH 1/5] Add generic helpers for arch IPI function calls Jens Axboe
2008-03-19 11:56 ` [PATCH 2/5] x86: convert to generic helpers for " Jens Axboe
2008-03-19 11:56 ` [PATCH 3/5] x86-64: " Jens Axboe
2008-03-19 11:56 ` [PATCH 4/5] powerpc: " Jens Axboe
2008-03-19 11:56 ` [PATCH 5/5] ia64: " Jens Axboe
2008-03-21  9:53 ` [PATCH 0/5] Generic smp_call_function(), improvements, and smp_call_function_single() Ingo Molnar
2008-03-21 13:15   ` Jens Axboe
2008-03-25  8:00     ` Nick Piggin [this message]
2008-03-27 10:08     ` Ingo Molnar
2008-03-27 10:37       ` Jens Axboe
2008-03-27 10:43         ` Ingo Molnar
2008-03-27 12:02           ` Jens Axboe
2008-03-27 12:32             ` Ingo Molnar
2008-03-27 12:35               ` Jens Axboe
2008-03-21 18:22 ` Luck, Tony
2008-03-21 18:31   ` Jens Axboe
2008-03-21 18:56     ` Luck, Tony
2008-03-22 12:29       ` Jens Axboe
2008-03-24 16:45         ` Luck, Tony
2008-03-24 20:28         ` Luck, Tony
2008-03-25  8:12           ` Jens Axboe
2008-03-25 16:48             ` Luck, Tony
2008-03-25 18:00               ` Jens Axboe
2008-03-21 20:04     ` Luck, Tony

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=200803251900.26154.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=npiggin@suse.de \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox