[lkml]   [2021]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] PCI/P2PDMA: finish RCU conversion of pdev->p2pdma

On 2021-07-01 3:56 a.m., Eric Dumazet wrote:
> From: Eric Dumazet <>
> While looking at pci_alloc_p2pmem() I found rcu protection
> was not properly applied there, as pdev->p2pdma was
> potentially read multiple times.
> I decided to fix pci_alloc_p2pmem(), add __rcu qualifier
> to p2pdma field of struct pci_dev, and fix all
> other accesses to this field with proper rcu verbs.
> Fixes: 1570175abd16 ("PCI/P2PDMA: track pgmap references per resource, not globally")
> Signed-off-by: Eric Dumazet <>
> Cc: Dan Williams <>
> Cc: Ira Weiny <>
> Cc: Logan Gunthorpe <>
> Cc: Bjorn Helgaas <>
> Cc: Christoph Hellwig <>
> Cc: Greg Kroah-Hartman <>
> Cc: "Jérôme Glisse" <>
> Cc: "Rafael J. Wysocki" <>
> Cc:

Reviewed-by: Logan Gunthorpe <>

For history, though, Dan had originally suggested the full RCU
protection is not necessary and it was only a barrier to force the NULL
check on teardown to resolve:

Things may have changed since then and other uses might be racing with
the teardown, so having it marked __rcu and fully protected sounds like
a good idea to me.


 \ /
  Last update: 2021-07-05 18:13    [W:0.047 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site