From: Pavel Begunkov <asml.silence@gmail.com>
To: sashiko-reviews@lists.linux.dev
Cc: media-ci@linuxtv.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 01/13] dma-buf: introduce initial file I/O infrastructure
Date: Tue, 22 Sep 2026 10:08:38 +0100 [thread overview]
Message-ID: <17884261-52ab-484e-a39a-01e67f7a1d2e@gmail.com> (raw)
In-Reply-To: <20260921135344.035B81F000FF@smtp.kernel.org>
On 9/21/26 14:53, sashiko-bot@kernel.org wrote:
...>> }
> [ ... ]
>> +int dma_buf_io_init_map(struct dma_buf_io_ctx *ctx, struct dma_buf_io_map *map,
>> + struct sg_table *sgt)
>> +{
>> + unsigned seg_shift = ~0U;
>> + struct scatterlist *sg;
>> + unsigned long tmp;
>> + int ret;
>> +
>> + for_each_sgtable_dma_sg(sgt, sg, tmp)
>> + seg_shift = min(seg_shift, __ffs(sg_dma_len(sg)));
>> +
>> + ret = percpu_ref_init(&map->refs, dma_buf_io_map_refs_release, 0,
>> + GFP_KERNEL);
>
> [Severity: High]
> Does this GFP_KERNEL allocation violate DMA-buf locking rules?
>
> dma_buf_io_create_map() calls ctx->dev_ops->map(ctx) while holding the
> dmabuf->resv ww_mutex. If the driver then calls dma_buf_io_init_map() under
> this lock, the GFP_KERNEL allocation could deadlock if memory reclaim
> attempts to acquire dma_resv locks.
Most of these look trivial, going to fix them. This one, however,
doesn't sound true AFAIU, I haven't heard about any blank ban on
GFP_KERNEL allocation under resv lock.
--
Pavel Begunkov
next prev parent reply other threads:[~2026-09-22 9:08 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 13:38 [PATCH v6 00/13] Add dmabuf read/write via io_uring Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 01/13] dma-buf: introduce initial file I/O infrastructure Pavel Begunkov
2026-09-21 13:53 ` sashiko-bot
2026-09-22 9:08 ` Pavel Begunkov [this message]
2026-09-30 6:54 ` Matthew Brost
2026-09-30 10:03 ` Pavel Begunkov
2026-09-30 3:00 ` Matthew Brost
2026-09-30 10:08 ` Pavel Begunkov
2026-09-30 12:48 ` Pavel Begunkov
2026-09-30 19:43 ` Matthew Brost
2026-10-05 11:49 ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 02/13] iov_iter: add iterator type for dmabuf maps Pavel Begunkov
2026-09-21 13:53 ` sashiko-bot
2026-09-22 9:15 ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 03/13] block: always adjust bi_offset on bio_advance_iter Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 04/13] block: introduce dma map backed bio type Pavel Begunkov
[not found] ` <20260922131610.GA30468@lst.de>
2026-09-22 13:54 ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 05/13] block: add dma-buf support for raw bdev Pavel Begunkov
2026-09-21 13:50 ` sashiko-bot
2026-09-21 13:38 ` [PATCH v6 06/13] nvme-pci: implement dma-buf backed requests Pavel Begunkov
2026-09-21 13:58 ` sashiko-bot
[not found] ` <20260922132016.GA30684@lst.de>
2026-09-22 13:37 ` Pavel Begunkov
[not found] ` <20260923045505.GB26231@lst.de>
2026-09-24 15:53 ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 07/13] nvme-pci: rename nvme_pci_sgl_set_data to nvme_pci_dma_iter_set_sgl Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 08/13] nvme-pci: add SGL support for the dmabuf path Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 09/13] io_uring/rsrc: introduce buf registration structure Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 10/13] io_uring/rsrc: extend buffer update Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 11/13] io_uring/rsrc: add uncloneable regbuf flag Pavel Begunkov
2026-09-21 13:53 ` sashiko-bot
2026-09-21 13:38 ` [PATCH v6 12/13] io_uring/rsrc: add regbuf import flags Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 13/13] io_uring/rsrc: add dmabuf backed registered buffers Pavel Begunkov
2026-09-21 13:54 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17884261-52ab-484e-a39a-01e67f7a1d2e@gmail.com \
--to=asml.silence@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=media-ci@linuxtv.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox