memcg: charge io_uring related objects
Subsystems (3)
PATCH 1/1 memcg: charge io_uring related objects
This patch is a more complete version than the previous one, adding accounting flags to nearly all syscall-triggerable kernel object allocations. The patch does not account for temporary objects, i.e., objects that are freed soon after allocation, to avoid meaningless performance penalty.
Thanks!
Yutian Yang,
Zhejiang University
--- fs/io-wq.c | 6 +++--- fs/io_uring.c | 54 +++++++++++++++++++++++++-------------------------- 2 files changed, 30 insertions(+), 30 deletions(-)
fs/io-wq.c +3 -3
@@ -1086,11 +1086,11 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)if (WARN_ON_ONCE (!data->free_work || !data->do_work))return ERR_PTR (-EINVAL ); - wq =kzalloc (sizeof (*wq),GFP_KERNEL ); + wq =kzalloc (sizeof (*wq),GFP_KERNEL_ACCOUNT );if (!wq)return ERR_PTR (-ENOMEM ); - wq->wqes =kcalloc (nr_node_ids,sizeof (struct io_wqe *),GFP_KERNEL ); + wq->wqes =kcalloc (nr_node_ids,sizeof (struct io_wqe *),GFP_KERNEL_ACCOUNT );if (!wq->wqes) goto err_wq;
@@ -1111,7 +1111,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)if (!node_online (alloc_node)) alloc_node =NUMA_NO_NODE ; - wqe =kzalloc_node (sizeof (struct io_wqe ),GFP_KERNEL , alloc_node); + wqe =kzalloc_node (sizeof (struct io_wqe ),GFP_KERNEL_ACCOUNT , alloc_node);if (!wqe) goto err; wq->wqes[node] = wqe;
fs/io_uring.c +27 -27
205 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 7 lines · Yutian Yang
This patch is a more complete version than the previous one, adding accounting flags to nearly all syscall-triggerable kernel object allocations. The patch does not account for temporary objects, i.e., objects that are freed soon after allocation, to avoid meaningless performance penalty.
Quoted 7 lines
Thanks!
Yutian Yang,
Zhejiang UniversitySigned-off-by Yutian Yang <[email protected]>
Can you please bring back the commit message of the previous version (which has the program to trigger the unaccounted allocations) and can add the details on this one to that?