Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558020 > unrolled thread

Re: [PATCH v4 07/15] lockdep: Implement crossrelease feature

Started byLai Jiangshan <jiangshanlai+lkml@gmail.com>
First post2017-01-13 05:40 +0100
Last post2017-01-13 06:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v4 07/15] lockdep: Implement crossrelease feature Lai Jiangshan <jiangshanlai+lkml@gmail.com> - 2017-01-13 05:40 +0100
    Re: [PATCH v4 07/15] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-01-13 06:10 +0100

#1558020 — Re: [PATCH v4 07/15] lockdep: Implement crossrelease feature

FromLai Jiangshan <jiangshanlai+lkml@gmail.com>
Date2017-01-13 05:40 +0100
SubjectRe: [PATCH v4 07/15] lockdep: Implement crossrelease feature
Message-ID<sZ1OG-4L0-15@gated-at.bofh.it>
> +
> +/*
> + * 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?

[toc] | [next] | [standalone]


#1558023

FromByungchul Park <byungchul.park@lge.com>
Date2017-01-13 06:10 +0100
Message-ID<sZ2hH-5a1-1@gated-at.bofh.it>
In reply to#1558020
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web