On 2019-03-18 11:48:28 [+], Liu, Yongxin wrote:
>
> >
> > Bummer. That would dead lock indeed.
> > Is it easily possible to recognize the recursive case?
>
> Not easily. I don't have test case for recursive call.
> For now, just code analysis.
So I've been playing with qemu's nvdimm
er.kernel.org;
> t...@linutronix.de; rost...@goodmis.org; dan.j.willi...@intel.com;
> pagu...@redhat.com; Gortmaker, Paul; linux-nvdimm@lists.01.org
> Subject: Re: [PATCH RT] nvdimm: make lane acquirement RT aware
>
> On 2019-03-18 01:41:10 [+], Liu, Yongxin wrote:
&g
On 2019-03-11 00:44:58 [+], Liu, Yongxin wrote:
> > but you still have the ndl_lock->lock which protects the resource. So in
> > the unlikely (but possible event) that you switch CPUs after obtaining
> > the CPU number you block on the lock. No harm is done, right?
>
> The resource "lane" can
er.kernel.org;
> t...@linutronix.de; rost...@goodmis.org; dan.j.willi...@intel.com;
> pagu...@redhat.com; Gortmaker, Paul; linux-nvdimm@lists.01.org
> Subject: Re: [PATCH RT] nvdimm: make lane acquirement RT aware
>
> On 2019-03-08 00:07:41 [+], Liu, Yongxin wrote:
> > Th
On 2019-03-08 00:07:41 [+], Liu, Yongxin wrote:
> The lane is critical resource which needs to be protected. One CPU can use
> only one
> lane. If CPU number is greater than the number of total lane, the lane can be
> shared
> among CPUs.
>
> In non-RT kernel, get_cpu() disable preemption
> Currently, nvdimm driver isn't RT compatible.
> nd_region_acquire_lane() disables preemption with get_cpu() which
> causes "scheduling while atomic" spews on RT, when using fio to test
> pmem as block device.
>
> In this change, we replace get_cpu/put_cpu with local_lock_cpu/
>
er.kernel.org;
> t...@linutronix.de; rost...@goodmis.org; dan.j.willi...@intel.com;
> pagu...@redhat.com; Gortmaker, Paul; linux-nvdimm@lists.01.org
> Subject: Re: [PATCH RT] nvdimm: make lane acquirement RT aware
>
> On 2019-03-06 17:57:09 [+0800], Yongxin Liu wrote:
> > In
On 2019-03-06 17:57:09 [+0800], Yongxin Liu wrote:
> In this change, we replace get_cpu/put_cpu with local_lock_cpu/
> local_unlock_cpu, and introduce per CPU variable "ndl_local_lock".
> Due to preemption on RT, this lock can avoid race condition for the
> same lane on the same CPU. When CPU
On Wed, Mar 6, 2019 at 2:05 AM Yongxin Liu wrote:
>
> Currently, nvdimm driver isn't RT compatible.
> nd_region_acquire_lane() disables preemption with get_cpu() which
> causes "scheduling while atomic" spews on RT, when using fio to test
> pmem as block device.
>
> In this change, we replace