From: Dmitry Safonov <dima@arista.com>
To: Mike Galbraith <efault@gmx.de>, linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
Ingo Molnar <mingo@kernel.org>,
"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mauro Carvalho Chehab <mchehab@s-opensource.com>,
Paolo Abeni <pabeni@redhat.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
Radu Rendec <rrendec@arista.com>, Rik van Riel <riel@redhat.com>,
Stanislaw Gruszka <sgruszka@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Wanpeng Li <wanpeng.li@hotmail.com>
Subject: Re: [RFC 4/6] softirq: Run per-group per-cpu ksoftirqd thread
Date: Thu, 18 Jan 2018 17:53:24 +0000 [thread overview]
Message-ID: <1516298004.2762.11.camel@arista.com> (raw)
In-Reply-To: <1516294803.8020.11.camel@gmx.de>
On Thu, 2018-01-18 at 18:00 +0100, Mike Galbraith wrote:
> On Thu, 2018-01-18 at 16:12 +0000, Dmitry Safonov wrote:
> >
> > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> > index 2ea09896bd6e..17e1a04445fa 100644
> > --- a/include/linux/interrupt.h
> > +++ b/include/linux/interrupt.h
> > @@ -508,11 +508,21 @@ extern void __raise_softirq_irqoff(unsigned
> > int nr);
> > extern void raise_softirq_irqoff(unsigned int nr);
> > extern void raise_softirq(unsigned int nr);
> >
> > -DECLARE_PER_CPU(struct task_struct *, ksoftirqd);
> > +extern struct task_struct *__percpu **ksoftirqd;
> > +extern unsigned nr_softirq_groups;
> >
> > -static inline struct task_struct *this_cpu_ksoftirqd(void)
> > +extern bool servicing_softirq(unsigned nr);
> > +static inline bool current_is_ksoftirqd(void)
> > {
> > - return this_cpu_read(ksoftirqd);
> > + unsigned i;
> > +
> > + if (!ksoftirqd)
> > + return false;
> > +
> > + for (i = 0; i < nr_softirq_groups; i++)
> > + if (*this_cpu_ptr(ksoftirqd[i]) ==
> > current)
> > + return true;
> > + return false;
> > }
>
> I haven't read all this, but in a quick drive-by this poked me in the
> eye. For RT tree fully threaded softirqs, I stole a ->flags bit to
> identify threads ala PF_KTHREAD (PF_KSOFTIRQD). In previous
> versions,
> I added a bit field to do the same, either is quicker than rummaging.
Yeah, thank you. It perfectly makes sense to use flags to identify
ksoftirqd thread. How do you identify in RT one ksoftirqd thread from
another? I mean, to find which softirq nr the thread is servicing?
--
Thanks,
Dmitry
next prev parent reply other threads:[~2018-01-18 17:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-18 16:12 [RFC 0/6] Multi-thread per-cpu ksoftirqd Dmitry Safonov
2018-01-18 16:12 ` [RFC 1/6] softirq: Add softirq_groups boot parameter Dmitry Safonov
2018-01-18 16:12 ` [RFC 2/6] softirq: Introduce mask for __do_softirq() Dmitry Safonov
2018-01-18 16:12 ` [RFC 3/6] softirq: Add reverse group-to-softirq map Dmitry Safonov
2018-01-18 16:12 ` [RFC 4/6] softirq: Run per-group per-cpu ksoftirqd thread Dmitry Safonov
2018-01-18 17:00 ` Mike Galbraith
2018-01-18 17:53 ` Dmitry Safonov [this message]
2018-01-18 18:28 ` Mike Galbraith
2018-01-18 16:12 ` [RFC 5/6] softirq: Add time accounting per-softirq type Dmitry Safonov
2018-01-18 16:12 ` [RFC 6/6] softirq/sched: Account si cpu time to ksoftirqd(s) Dmitry Safonov
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=1516298004.2762.11.camel@arista.com \
--to=dima@arista.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.levin@verizon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@s-opensource.com \
--cc=mingo@kernel.org \
--cc=pabeni@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=rrendec@arista.com \
--cc=sgruszka@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=wanpeng.li@hotmail.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
all inboxes | Powered by JetHome®