From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Maxime Ripard <mripard@kernel.org>,
Paul Kocialkowski <paulk@sys-base.io>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Chen-Yu Tsai <wens@kernel.org>,
Samuel Holland <samuel@sholland.org>,
Hans Verkuil <hverkuil@kernel.org>,
aiyengar1990@gmail.com
Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
Arun Iyengar <aiyengar1990@gmail.com>
Subject: Re: [PATCH v2 1/2] media: cedrus: fail buffer allocations that do not fit with -ENOMEM
Date: Sat, 28 Nov 2026 19:30:56 +0100 [thread overview]
Message-ID: <RfFbI8ONQVOfjM3r1bq-gw@gmail.com> (raw)
In-Reply-To: <20261128-b4-cedrus-generic-fixes-v2-1-af8472be660b@gmail.com>
Dne sobota, 28. november 2026 ob 18:35:52 Srednjeevropski standardni čas je Arun Iyengar via B4 Relay napisal(a):
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> Behind an IOMMU, vb2-dma-contig builds buffers from GFP_KERNEL pages,
> so a buffer pool that does not fit in memory invokes the OOM killer.
> CMA allocations fail directly and are not affected.
>
> Set __GFP_RETRY_MAYFAIL on both queues: the request then returns fewer
> buffers or -ENOMEM.
>
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> index ad4ec3490775..9b2d24e77fdb 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> @@ -602,6 +602,7 @@ int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
> src_vq->dev = ctx->dev->dev;
> src_vq->supports_requests = true;
> src_vq->requires_requests = true;
> + src_vq->gfp_flags = __GFP_RETRY_MAYFAIL;
>
> ret = vb2_queue_init(src_vq);
> if (ret)
> @@ -616,6 +617,7 @@ int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
> dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
> dst_vq->lock = &ctx->dev->dev_mutex;
> dst_vq->dev = ctx->dev->dev;
> + dst_vq->gfp_flags = __GFP_RETRY_MAYFAIL;
>
> return vb2_queue_init(dst_vq);
> }
>
>
next prev parent reply other threads:[~2026-11-28 18:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 17:35 [PATCH v2 0/2] media: cedrus: allocation failure and capture payload fixes Arun Iyengar
2026-11-28 17:35 ` Arun Iyengar via B4 Relay
2026-11-28 17:35 ` [PATCH v2 1/2] media: cedrus: fail buffer allocations that do not fit with -ENOMEM Arun Iyengar
2026-11-28 17:35 ` Arun Iyengar via B4 Relay
2026-11-28 18:30 ` Jernej Škrabec [this message]
2026-11-28 17:35 ` [PATCH v2 2/2] media: cedrus: report only the picture as capture payload Arun Iyengar
2026-11-28 17:35 ` Arun Iyengar via B4 Relay
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=RfFbI8ONQVOfjM3r1bq-gw@gmail.com \
--to=jernej.skrabec@gmail.com \
--cc=aiyengar1990@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-sunxi@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mripard@kernel.org \
--cc=paulk@sys-base.io \
--cc=samuel@sholland.org \
--cc=wens@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.