From: Tao Cui <cui.tao@linux.dev>
To: sashiko-reviews@lists.linux.dev, akpm@linux-foundation.org,
dgilbert@interlog.com, mkp@kernel.org, loberman@redhat.com,
jmeneghi@redhat.com, kraxel@redhat.com,
vivek.kasireddy@intel.com, mst@redhat.com, jasowangio@gmail.com,
eperezma@redhat.com, stefanha@redhat.com, sgarzare@redhat.com,
rostedt@goodmis.org, vdonnefort@google.com, mhiramat@kernel.org,
jgg@ziepe.ca, kevin.tian@intel.com, axboe@kernel.dk
Cc: cui.tao@linux.dev, linux-mm@kvack.org,
James.Bottomley@HansenPartnership.com, sumit.semwal@linaro.org,
christian.koenig@amd.com, phasta@kernel.org, joro@8bytes.org,
will@kernel.org, linux-scsi@vger.kernel.org,
dri-devel@lists.freedesktop.org, kvm@vger.kernel.org,
virtualization@lists.linux.dev,
linux-trace-kernel@vger.kernel.org, bobbyeshleman@meta.com,
mathieu.desnoyers@efficios.com, robin.murphy@arm.com,
mason@kernel.org, aesteve@redhat.com, tjmercier@google.com,
harry@kernel.org, vbabka@suse.cz, cuitao@kylinos.cn,
media-ci@linuxtv.org
Subject: Re: [PATCH 6/7] io_uring: account the ring context and SQPOLL thread data to memcg
Date: Mon, 9 Nov 2026 10:37:34 +0800 [thread overview]
Message-ID: <16b5464d-d4a2-420e-9de0-2ccddb860e3b@linux.dev> (raw)
In-Reply-To: <sashiko-outbox-202923@kernel.org>
Hi,
在 2026/11/7 21:27, sashiko-bot@kernel.org 写道:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Low] io_uring: commit message omits rsrc and tctx changes and
> uncharged allocs
Thanks for catching this.
You're right that the changelog should better match the actual changes.
Besides io_ring_ctx and io_sq_data, this patch also switches the
allocations in io_coalesce_buffer(), io_init_wq_offload(), and
io_uring_alloc_task_context() to GFP_KERNEL_ACCOUNT. I'll mention
those explicitly in v2.
You're also right that "the last per-ring allocations" overstates the
current state. Patch 7 still leaves some infrastructure allocations,
such as the percpu pieces and the io-wq cpumask, unchanged. I'll drop
that wording and instead describe what this patch accounts and what
remains.
As for commits 075d5837bafc and 0b34e7b20a48, this series is based on
linux-next (next-20261104), which already includes the
io_uring-7.4-20261029 tag containing those commits. If the review is
performed against a tree without that tag, those objects will indeed
still appear uncharged.
Thanks,
Tao
> --
>
> commit 3d47975c4208930279f98824279734ca99b5e9bd
> Author: Tao Cui <cuitao@kylinos.cn>
>
>> io_uring: account the ring context and SQPOLL thread data to memcg
>>
>> The io_ring_ctx and the SQPOLL io_sqd are the last per-ring allocations
>> made with plain GFP_KERNEL. The larger surfaces around them are
>> already charged: io_mapped_ubuf and io_rsrc_node since commit
>> 075d5837bafc ("io_uring/rsrc: charge buffer arrays and nodes to memcg"),
>> the tctx node and its XArrays since commit 0b34e7b20a48 ("io_uring:
>> charge tctx nodes and personalities").
>>
>> Charge the context and the SQPOLL thread data the same way.
>>
>> Signed-off-by: Tao Cui <cuitao@kylinos.cn>
>
> [Severity: Low]
> Does the commit message match the actual changes and current tree state?
>
> Alongside io_ring_ctx and io_sq_data, the patch also switches new_array in
> io_coalesce_buffer(), ctx->hash_map in io_init_wq_offload(), and
> io_uring_task in io_uring_alloc_task_context() to GFP_KERNEL_ACCOUNT without
> mentioning them in the subject or changelog.
>
> The changelog also says these are the last per-ring GFP_KERNEL allocations.
> While commit "io_uring: account the remaining per-object allocations to
> memcg" later in the series converts io_alloc_cache_init() and io_wq_create(),
> percpu_ref_init(&ctx->refs, ...) in io_ring_ctx_alloc(),
> percpu_counter_init(&tctx->inflight, ...) in io_uring_alloc_task_context(),
> and alloc_cpumask_var(&wq->cpu_mask, ...) in io_wq_create() still use plain
> GFP_KERNEL.
>
> Finally, the cited commits 075d5837bafc ("io_uring/rsrc: charge buffer
> arrays and nodes to memcg") and 0b34e7b20a48 ("io_uring: charge tctx nodes
> and personalities") are not present in the base tree, so io_alloc_imu(),
> io_rsrc_node_alloc(), io_tctx_install_node(), tctx->xa, and
> ctx->personalities remain uncharged.
>
next prev parent reply other threads:[~2026-11-09 2:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 13:18 [PATCH 0/7] memcg: account the remaining uncharged kernel allocations Tao Cui
2026-11-06 13:18 ` [PATCH 1/7] scsi: sg and st: account the command buffer memory to memcg Tao Cui
2026-11-07 13:27 ` sashiko-bot
2026-11-09 2:25 ` Tao Cui
2026-11-06 13:18 ` [PATCH 2/7] dma-buf/udmabuf: account the page array metadata " Tao Cui
2026-11-06 13:23 ` Christian König
2026-11-06 17:25 ` T.J. Mercier
2026-11-09 2:32 ` Tao Cui
2026-11-09 10:56 ` Christian König
2026-11-09 13:44 ` Albert Esteve
2026-11-07 13:27 ` sashiko-bot
2026-11-06 13:18 ` [PATCH 3/7] vhost: account the per-device kernel allocations " Tao Cui
2026-11-07 13:27 ` sashiko-bot
2026-11-06 13:18 ` [PATCH 4/7] tracing: account ring buffer pages and trace_array metadata " Tao Cui
2026-11-07 13:27 ` sashiko-bot
2026-11-09 2:35 ` Tao Cui
2026-11-11 16:47 ` Vincent Donnefort
2026-11-11 23:14 ` Steven Rostedt
2026-11-06 13:18 ` [PATCH 5/7] iommufd: account the hw_queue page array " Tao Cui
2026-11-07 13:27 ` sashiko-bot
2026-11-06 13:18 ` [PATCH 6/7] io_uring: account the ring context and SQPOLL thread data " Tao Cui
2026-11-07 13:27 ` sashiko-bot
2026-11-09 2:37 ` Tao Cui [this message]
2026-11-06 13:18 ` [PATCH 7/7] io_uring: account the remaining per-object allocations " Tao Cui
2026-11-07 13:27 ` 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=16b5464d-d4a2-420e-9de0-2ccddb860e3b@linux.dev \
--to=cui.tao@linux.dev \
--cc=James.Bottomley@HansenPartnership.com \
--cc=aesteve@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=bobbyeshleman@meta.com \
--cc=christian.koenig@amd.com \
--cc=cuitao@kylinos.cn \
--cc=dgilbert@interlog.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eperezma@redhat.com \
--cc=harry@kernel.org \
--cc=jasowangio@gmail.com \
--cc=jgg@ziepe.ca \
--cc=jmeneghi@redhat.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=loberman@redhat.com \
--cc=mason@kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=media-ci@linuxtv.org \
--cc=mhiramat@kernel.org \
--cc=mkp@kernel.org \
--cc=mst@redhat.com \
--cc=phasta@kernel.org \
--cc=robin.murphy@arm.com \
--cc=rostedt@goodmis.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=sumit.semwal@linaro.org \
--cc=tjmercier@google.com \
--cc=vbabka@suse.cz \
--cc=vdonnefort@google.com \
--cc=virtualization@lists.linux.dev \
--cc=vivek.kasireddy@intel.com \
--cc=will@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.