lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251023134047.GA24570@lst.de>
Date: Thu, 23 Oct 2025 15:40:47 +0200
From: Christoph Hellwig <hch@....de>
To: Caleb Sander Mateos <csander@...estorage.com>
Cc: Jens Axboe <axboe@...nel.dk>, Miklos Szeredi <miklos@...redi.hu>,
	Ming Lei <ming.lei@...hat.com>, Keith Busch <kbusch@...nel.org>,
	Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
	Chris Mason <clm@...com>, David Sterba <dsterba@...e.com>,
	io-uring@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-block@...r.kernel.org, linux-nvme@...ts.infradead.org,
	linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] io_uring/uring_cmd: avoid double indirect call in
 task work dispatch

On Wed, Oct 22, 2025 at 05:13:26PM -0600, Caleb Sander Mateos wrote:
> io_uring task work dispatch makes an indirect call to struct io_kiocb's
> io_task_work.func field to allow running arbitrary task work functions.
> In the uring_cmd case, this calls io_uring_cmd_work(), which immediately
> makes another indirect call to struct io_uring_cmd's task_work_cb field.
> Introduce a macro DEFINE_IO_URING_CMD_TASK_WORK() to define a
> io_req_tw_func_t function wrapping an io_uring_cmd_tw_t. Convert the
> io_uring_cmd_tw_t function to the io_req_tw_func_t function in
> io_uring_cmd_complete_in_task() and io_uring_cmd_do_in_task_lazy().
> Use DEFINE_IO_URING_CMD_TASK_WORK() to define a io_req_tw_func_t
> function for each existing io_uring_cmd_tw_t function. Now uring_cmd
> task work dispatch makes a single indirect call to the io_req_tw_func_t
> wrapper function, which can inline the io_uring_cmd_tw_t function. This
> also allows removing the task_work_cb field from struct io_uring_cmd,
> freeing up some additional storage space.

Please just open code the logic instead of the symbol-hiding multi-level
macro indirection.  Everyone who will have to touch the code in the
future will thank you.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ