The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Ali Ahmet Memis <ali@iusegentoo.com>, Jens Axboe <axboe@kernel.dk>
Cc: Pavel Begunkov <asml.silence@gmail.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: io_uring/memmap: compound allocation larger than accounted region
Date: Thu, 06 Aug 2026 12:21:54 -0400	[thread overview]
Message-ID: <87ik5ncj8d.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20260806154200.183725-1-ali@iusegentoo.com>

Ali Ahmet Memis <ali@iusegentoo.com> writes:

> io_mem_alloc_compound() allocates get_order(size) pages, while
> io_create_region() accounts reg->size >> PAGE_SHIFT. For a ring with 4096 SQ
> entries and the default CQ size that is 64 pages allocated against 37
> accounted.
>
> Is that intentional? memcg charges the full allocation, so only RLIMIT_MEMLOCK
> undercounts, and the gap is bounded by 2x. I did not want to send a patch for
> something that may well be a deliberate trade for the single folio.

I don't think that is intentional, beyond a simplification of the
code.  If it is, it seems like a bad idea. Not necessarily harmful in
itself, but we should be accounting properly and not doing it if it goes
above the rlimit.

-- 
Gabriel Krisman Bertazi

      reply	other threads:[~2026-08-06 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 15:42 io_uring/memmap: compound allocation larger than accounted region Ali Ahmet Memis
2026-08-06 16:21 ` Gabriel Krisman Bertazi [this message]

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=87ik5ncj8d.fsf@mailhost.krisman.be \
    --to=krisman@suse.de \
    --cc=ali@iusegentoo.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox