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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YpeaCSvFo1Mqvsgv@iweiny-desk3>
Date:   Wed, 1 Jun 2022 09:55:37 -0700
From:   Ira Weiny <ira.weiny@...el.com>
To:     Davidlohr Bueso <dave@...olabs.net>
Cc:     Dan Williams <dan.j.williams@...el.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Alison Schofield <alison.schofield@...el.com>,
        Vishal Verma <vishal.l.verma@...el.com>,
        Dave Jiang <dave.jiang@...el.com>,
        Ben Widawsky <ben@...dawsk.net>, linux-kernel@...r.kernel.org,
        linux-cxl@...r.kernel.org, linux-pci@...r.kernel.org,
        a.manzanares@...sung.com
Subject: Re: [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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ