From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
"David S. Miller" <davem@davemloft.net>,
Ingo Molnar <mingo@kernel.org>, Kevin Hilman <khilman@linaro.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Paul Mackerras <paulus@samba.org>,
Russell King <linux@arm.linux.org.uk>,
Thomas Gleixner <tglx@linutronix.de>,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH 1/5] irq_work: Architecture support for remote irq work raise
Date: Mon, 12 May 2014 18:26:49 +0200 [thread overview]
Message-ID: <20140512162641.GA28033@localhost.localdomain> (raw)
In-Reply-To: <20140512075650.GJ30445@twins.programming.kicks-ass.net>
On Mon, May 12, 2014 at 09:56:50AM +0200, Peter Zijlstra wrote:
> On Mon, May 12, 2014 at 01:33:53AM +0200, Frederic Weisbecker wrote:
> > We are going to extend irq work to support remote queuing.
> >
> > So lets add a cpu argument to arch_irq_work_raise(). The architectures
> > willing to support that must then provide the backend to raise irq work
> > IPIs remotely.
> >
> > Initial support is provided for x86 and ARM since they are easily
> > extended. The other archs that overwrite arch_irq_work_raise() seem
> > to use local clock interrupts and therefore need deeper rewrite of their
> > irq work support to implement remote raising.
> >
>
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
>
> Why not borrow the smp_call_function IPI for the remote bits? We could
> limit the 'safe from NMI' to the local works. And we validate this by
> putting a WARN_ON(in_nmi()) in irq_work_queue_on().
Right, but although I don't need it to be safe from NMI, I need it
to be callable concurrently and when irqs are disabled.
So we can't use smp_call_function_single() for that. But we can use the async
version in which case we must keep the irq work claim. But that's
about the same than smp_queue_function_single() we had previously
and we are back with our csd_lock issue.
>
> At some later stage we could look at maybe merging the smp_function_call
> and irq_work into a single thing, where we have the irq_work interface
> as async and the smp_function_call() as sync interface.
>
> But for now a quick 'hack' would be to call __irq_work_run() from
> generic_smp_call_function_single_interrupt().
>
> That would leave arch_irq_work_raise() as the special NMI safe local IPI
> hook.
I don't know, calling irq_work_run() from there sounds like an overkill.
Or we can encapsulate:
struct remote_irq_work {
struct irq_work work;
struct call_single_data csd;
}
bool irq_work_queue_on(remote_work, cpu)
{
if (irq_work_claim(remote_work.work))
return false;
remote_work.csd.func = irq_work_remote_interrupt;
remotr_work.csd.info = work
smp_call_function_single_async(&remote_work.csd, cpu);
}
void irq_work_remote_interrupt(void *info)
{
struct irq_work *work = info;
work->func(work);
}
And some tweaking to make csd_lock() out of the way. smp_call_function_single_async()
don't need it.
Or the two other solutions:
1) expand irq_work to support remote queuing. And really this hasn't added more
atomic operations nor smp barriers that the local queuing. The only complication
is that we need remote raise support from arch.
2) expand smp_call_function stuff with smp_queue_function_single(). As I did
previously. It's the same than the above irq_work_queue_on() above will need to be
conditional though.
The native remote support on irq_work sounds to me the most proper. But unfortunately
it requires support from arch that we already have with smp_function...
next prev parent reply other threads:[~2014-05-12 16:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 23:33 [RFC PATCH 0/5] nohz: Move nohz kick out of scheduler IPI, v3 Frederic Weisbecker
2014-05-11 23:33 ` [PATCH 1/5] irq_work: Architecture support for remote irq work raise Frederic Weisbecker
2014-05-12 0:08 ` Benjamin Herrenschmidt
2014-05-12 3:11 ` Benjamin Herrenschmidt
2014-05-12 16:29 ` Frederic Weisbecker
2014-05-12 7:56 ` Peter Zijlstra
2014-05-12 16:26 ` Frederic Weisbecker [this message]
2014-05-12 17:17 ` Peter Zijlstra
2014-05-12 17:41 ` Frederic Weisbecker
2014-05-11 23:33 ` [PATCH 2/5] irq_work: Force non-lazy works on IPI Frederic Weisbecker
2014-05-11 23:33 ` [PATCH 3/5] irq_work: Allow remote queueing Frederic Weisbecker
2014-05-11 23:33 ` [PATCH 4/5] nohz: Move full nohz kick to its own IPI Frederic Weisbecker
2014-05-11 23:33 ` [PATCH 5/5] nohz: Use IPI implicit full barrier against rq->nr_running r/w Frederic Weisbecker
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=20140512162641.GA28033@localhost.localdomain \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=khilman@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=viresh.kumar@linaro.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