lkml.org 
[lkml]   [2022]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 3/9] PCI: Create PCI library functions in support of DOE mailboxes.
On Wed, Jun 01, 2022 at 06:59:09AM -0700, Davidlohr Bueso wrote:
> On Tue, 31 May 2022, Ira Weiny wrote:
> > Thinking about it I don't see a benefit to a rwlock. We don't have multiple
> > readers.
>
> ... but you have concurrent workqueues reading the value of cur_task.

No, concurrent workqueues are reading the value of different DOE mailboxes'
cur_task. Each mailbox has it's own lock for its current task.

This is a multiple writers to a single reader pattern. The lock serializes
driver requests (possibly from different threads) into the single mailbox as
well as signaling when the cur_task is done; retire_cur_task().

At the same time multiple mailboxes can be running parallel.

I don't think taking the lock in doe_statemachine_work() is technically
necessary. But I left it there for completeness because if the queue depth is
increased like it was in Jonathans original code the locking around cur_task
will need to be adjusted in this area.

Ira

>
> Thanks,
> Davidlohr

\
 
 \ /
  Last update: 2022-06-01 18:57    [W:0.093 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site