lkml.org 
[lkml]   [2017]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 07/15] lockdep: Implement crossrelease feature
On Fri, Jan 13, 2017 at 12:39:04PM +0800, Lai Jiangshan wrote:
> > +
> > +/*
> > + * No contention. Irq disable is only required.
> > + */
> > +static int same_context_plock(struct pend_lock *plock)
> > +{
> > + struct task_struct *curr = current;
> > + int cpu = smp_processor_id();
> > +
> > + /* In the case of hardirq context */
> > + if (curr->hardirq_context) {
> > + if (plock->hardirq_id != per_cpu(hardirq_id, cpu) ||
> > + plock->hardirq_context != curr->hardirq_context)
> > + return 0;
> > + /* In the case of softriq context */
> > + } else if (curr->softirq_context) {
> > + if (plock->softirq_id != per_cpu(softirq_id, cpu) ||
> > + plock->softirq_context != curr->softirq_context)
> > + return 0;
> > + /* In the case of process context */
> > + } else {
> > + if (plock->hardirq_context != 0 ||
> > + plock->softirq_context != 0)
> > + return 0;
> > + }
> > + return 1;
> > +}
> >
>
> I have not read the code yet...
> but different work functions in workqueues are different "contexts" IMO,
> does commit operation work well in work functions?

Hello,

Yes. I also think it should be considered since each work might be run in
different context from another, thanks to concurrency support of workqueue.
I will reflect it.

Thanks,
Byungchul

\
 
 \ /
  Last update: 2017-01-13 06:04    [W:0.121 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site