lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 18 Jan 2018 17:53:24 +0000
From:   Dmitry Safonov <dima@...sta.com>
To:     Mike Galbraith <efault@....de>, linux-kernel@...r.kernel.org
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        David Miller <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Frederic Weisbecker <fweisbec@...il.com>,
        Hannes Frederic Sowa <hannes@...essinduktion.org>,
        Ingo Molnar <mingo@...nel.org>,
        "Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Mauro Carvalho Chehab <mchehab@...pensource.com>,
        Paolo Abeni <pabeni@...hat.com>,
        "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Radu Rendec <rrendec@...sta.com>,
        Rik van Riel <riel@...hat.com>,
        Stanislaw Gruszka <sgruszka@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [RFC 4/6] softirq: Run per-group per-cpu ksoftirqd thread

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ