[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <06711233-64e7-4f24-8c37-40a90c6db1c5@moroto.mountain>
Date: Fri, 5 Jan 2024 10:26:22 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Logan Gunthorpe <logang@...tatee.com>,
Eric Dumazet <edumazet@...gle.com>, alexis.lothore@...tlin.com,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: Re: [PATCH] PCI/P2PDMA: Fix a sleeping issue in a RCU read section
On Thu, Jan 04, 2024 at 08:52:35PM +0100, Christophe JAILLET wrote:
> It is not allowed to sleep within a RCU read section, so use GFP_ATOMIC
> instead of GFP_KERNEL here.
>
> Fixes: ae21f835a5bd ("PCI/P2PDMA: Finish RCU conversion of pdev->p2pdma")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> This patch is speculative.
> It is based on a discussion related to another patch. See [1].
>
> It also matches the doc, IIUC. See [2]
>
> [1]: https://lore.kernel.org/all/20240104143925.194295-3-alexis.lothore@bootlin.com/
> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/RCU/whatisRCU.rst#n161
Looks good to me.
Smatch is supposed to catch this sort of bug but there are some issues
with xa_store it's normally holding the the xas_lock() but if you pass
a sleeping GFP_ then it drops the lock in __xas_nomem(). Sort of
tricky. So right now all xa_store() stuff triggers a false positive
but tomorrows version of Smatch will just miss this bug.
regards,
dan carpenter
Powered by blists - more mailing lists