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: <cf0b8769-0365-2fd1-c87e-fe2e44052b51@kernel.dk>
Date:   Fri, 17 Jan 2020 15:49:49 -0700
From:   Jens Axboe <axboe@...nel.dk>
To:     Pavel Begunkov <asml.silence@...il.com>, io-uring@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] optimise sqe-to-req flags

On 1/17/20 3:41 PM, Pavel Begunkov wrote:
> *lost the cover-letter, but here we go*
> 
> The main idea is to optimise code like the following by directly
> copying sqe flags:
> 
> if (sqe_flags & IOSQE_IO_HARDLINK)
> 	req->flags |= REQ_F_HARDLINK;
> 
> The first patch is a minor cleanup, and the second one do the
> trick. No functional changes.
> 
> The other thing to consider is whether to use such flags as 
> REQ_F_LINK = IOSQE_IO_LINK, or directly use IOSQE_IO_LINK instead.

I think we should keep the names separate. I think it looks fine, though
I do wish that we could just have both in an enum and not have to do
weird naming. We sometimes do:

enum {
	__REQ_F_FOO
};

#define REQ_F_FOO	(1U << __REQ_F_FOO)

and with that we could have things Just Work in terms of numbering, if
we keep the overlapped values at the start. Would need IOSQE_* to also
use an enum, ala:

enum {
	__IOSQE_FIXED_FILE,
	__IOSQE_IO_DRAIN,
	...
};

and then do

#define IOSQE_FIXED_FILE	(1U << __IOSQE_FIXED_FILE)

and have the __REQ enum start with

enum {
	__REQ_F_FIXED_FILE = __IOSQE_FIXED_FILE,
	__REQ_F_IO_DRAIN = __IOSQE_IO_DRAIN,
	...
	__REQ_F_LINK_NEXT,
	__REQ_F_FAIL_LINK,
	...
};

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ