From nobody Fri Nov 15 15:49:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XqhK21kk3z5dHhr; Fri, 15 Nov 2024 15:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XqhK21D8Zz47nj; Fri, 15 Nov 2024 15:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731685750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M5+4zMtBlYoGmwmvRQK/BjbnC2Zy+L+mF6er1EzyOyM=; b=v/wNcmSGWHKP+JpZ5CKK/maYjtB05KxiWycpe/o714YJvowZuYSUeNJEU3Avm8Lp1MrLDn nscbdqe6y4ZQLUXNZBJXbZYjYO8F/guRr+P9bB/rGnQ4pg6irDda9ZnweQeioRQDccPL5d moQPFMMdKc5D5b8I8t1tdrzGtezbZr85bUJZom71hyVcBGHPIAWpalhv9cI9Xf45N4tAfn wZ1MrB3YlPHDS1dBXwdL3fopVRi3QlWP188sJKLDJi3MWXQvp1Ya7fE2nKM7M3aakRmjdf O2svtkYfvik4FA1qq+QtRLQoHNWCCiloVC7t4Fqb/k0Mz2yqSE4FPf63zqV4vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731685750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M5+4zMtBlYoGmwmvRQK/BjbnC2Zy+L+mF6er1EzyOyM=; b=cgdhDVavmoBCM545mRilUTqPkOQU0a4lbiAuaO0EY+uF7Xz9bjF/0i9S9AVLIbzPN0jMcf P1xGcpsPh6wWqvcjD8wkADmk8NCkSoAJY8X2/crudwwjIEiLzZiT06QU0PsrH8atl/s8T8 cB1RxVyC+SuGWUvm9ykIaKIRnPMtknsdE9/0EiJr1EW+TWrHMXovDdVw3xeUAg2S6ul4tq MuavJptDCOFOxB1AyxpY15ibuKypOhnAe12fvNv4fTc/c3GHFpDj57DJyEGL0GlBc9vRLP aPMHkGkA9w4qU3EkGT8zS81Rm6F4OWKZozeqArDBaIw/c2fZwLPOc2AzNW16IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731685750; a=rsa-sha256; cv=none; b=iPcuF9fXbztSjSHFtO1crFK+9ykSgvtzz7HAimj1GeGjo6sZZt6w6yI8YsrKIfxzm5Rn4R FoBjDvToki/nJCuVAYaHJzYlMg6oxsqH7C6y5uCmyAxzNw8+dovd6NNdfLF7d/LBkEdpOs G0sHwuZHRduulLG60c8ZR0ObNOeCiy105fgUUnMyID/waMiFNAFMXw+0t86eqzdGCztI36 Vbb08/7gr5bbarC3VVpwHNC5AIUMbLKqg/pwakV7EfDsewYATzs2bswvyMf/VzMtugLpm5 FEbremLSkFwgVKqhACoawyMudlg1aTBMk/rHbhsvqpzFsMXJkNNW7dKCTZdxZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XqhK20mVBzSX4; Fri, 15 Nov 2024 15:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AFFn9Fx074857; Fri, 15 Nov 2024 15:49:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AFFn9k3074854; Fri, 15 Nov 2024 15:49:09 GMT (envelope-from git) Date: Fri, 15 Nov 2024 15:49:09 GMT Message-Id: <202411151549.4AFFn9k3074854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 4605a99b51ab - main - aio: remove write-only jobid & kernelinfo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4605a99b51ab72351d7554fbadbb24985f4667b1 Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=4605a99b51ab72351d7554fbadbb24985f4667b1 commit 4605a99b51ab72351d7554fbadbb24985f4667b1 Author: Andrew Gallatin AuthorDate: 2024-11-15 15:41:34 +0000 Commit: Andrew Gallatin CommitDate: 2024-11-15 15:47:46 +0000 aio: remove write-only jobid & kernelinfo The jobid (which was stored in kernelinfo) was used to look up jobs until 1ce9182407f6, where it became essentially write only. Remove it to simplify the code and pave the way for future work to make aio scale better. Note this has been slated for removal "soon" for 18 years. Suggested by: jhb Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D47583 --- sys/kern/vfs_aio.c | 42 +----------------------------------------- sys/sys/aio.h | 2 +- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index e7302f4b7a9e..eb08716fbeda 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -71,12 +71,6 @@ #include #include -/* - * Counter for allocating reference ids to new jobs. Wrapped to 1 on - * overflow. (XXX will be removed soon.) - */ -static u_long jobrefid; - /* * Counter for aio_fsync. */ @@ -297,7 +291,6 @@ struct aiocb_ops { long (*fetch_error)(struct aiocb *ujob); int (*store_status)(struct aiocb *ujob, long status); int (*store_error)(struct aiocb *ujob, long error); - int (*store_kernelinfo)(struct aiocb *ujob, long jobref); int (*store_aiocb)(struct aiocb **ujobp, struct aiocb *ujob); }; @@ -418,7 +411,6 @@ aio_onceonly(void) aiolio_zone = uma_zcreate("AIOLIO", sizeof(struct aioliojob), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); aiod_lifetime = AIOD_LIFETIME_DEFAULT; - jobrefid = 1; p31b_setcfg(CTL_P1003_1B_ASYNCHRONOUS_IO, _POSIX_ASYNCHRONOUS_IO); p31b_setcfg(CTL_P1003_1B_AIO_MAX, MAX_AIO_QUEUE); p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, 0); @@ -1455,13 +1447,6 @@ aiocb_store_error(struct aiocb *ujob, long error) return (suword(&ujob->_aiocb_private.error, error)); } -static int -aiocb_store_kernelinfo(struct aiocb *ujob, long jobref) -{ - - return (suword(&ujob->_aiocb_private.kernelinfo, jobref)); -} - static int aiocb_store_aiocb(struct aiocb **ujobp, struct aiocb *ujob) { @@ -1475,7 +1460,6 @@ static struct aiocb_ops aiocb_ops = { .fetch_error = aiocb_fetch_error, .store_status = aiocb_store_status, .store_error = aiocb_store_error, - .store_kernelinfo = aiocb_store_kernelinfo, .store_aiocb = aiocb_store_aiocb, }; @@ -1486,7 +1470,6 @@ static struct aiocb_ops aiocb_ops_osigevent = { .fetch_error = aiocb_fetch_error, .store_status = aiocb_store_status, .store_error = aiocb_store_error, - .store_kernelinfo = aiocb_store_kernelinfo, .store_aiocb = aiocb_store_aiocb, }; #endif @@ -1507,7 +1490,6 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, int opcode; int error; int fd, kqfd; - int jid; u_short evflags; if (p->p_aioinfo == NULL) @@ -1517,7 +1499,6 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, ops->store_status(ujob, -1); ops->store_error(ujob, 0); - ops->store_kernelinfo(ujob, -1); if (num_queue_count >= max_queue_count || ki->kaio_count >= max_aio_queue_per_proc) { @@ -1630,16 +1611,8 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, job->fd_file = fp; mtx_lock(&aio_job_mtx); - jid = jobrefid++; job->seqno = jobseqno++; mtx_unlock(&aio_job_mtx); - error = ops->store_kernelinfo(ujob, jid); - if (error) { - error = EINVAL; - goto err3; - } - job->uaiocb._aiocb_private.kernelinfo = (void *)(intptr_t)jid; - if (opcode == LIO_NOP) { fdrop(fp, td); MPASS(job->uiop == &job->uio || job->uiop == NULL); @@ -2728,7 +2701,7 @@ filt_lio(struct knote *kn, long hint) struct __aiocb_private32 { int32_t status; int32_t error; - uint32_t kernelinfo; + uint32_t spare; }; #ifdef COMPAT_FREEBSD6 @@ -2807,7 +2780,6 @@ aiocb32_copyin_old_sigevent(struct aiocb *ujob, struct kaiocb *kjob, CP(job32, *kcb, aio_reqprio); CP(job32, *kcb, _aiocb_private.status); CP(job32, *kcb, _aiocb_private.error); - PTRIN_CP(job32, *kcb, _aiocb_private.kernelinfo); return (convert_old_sigevent32(&job32.aio_sigevent, &kcb->aio_sigevent)); } @@ -2844,7 +2816,6 @@ aiocb32_copyin(struct aiocb *ujob, struct kaiocb *kjob, int type) CP(job32, *kcb, aio_reqprio); CP(job32, *kcb, _aiocb_private.status); CP(job32, *kcb, _aiocb_private.error); - PTRIN_CP(job32, *kcb, _aiocb_private.kernelinfo); error = convert_sigevent32(&job32.aio_sigevent, &kcb->aio_sigevent); return (error); @@ -2886,15 +2857,6 @@ aiocb32_store_error(struct aiocb *ujob, long error) return (suword32(&ujob32->_aiocb_private.error, error)); } -static int -aiocb32_store_kernelinfo(struct aiocb *ujob, long jobref) -{ - struct aiocb32 *ujob32; - - ujob32 = (struct aiocb32 *)ujob; - return (suword32(&ujob32->_aiocb_private.kernelinfo, jobref)); -} - static int aiocb32_store_aiocb(struct aiocb **ujobp, struct aiocb *ujob) { @@ -2908,7 +2870,6 @@ static struct aiocb_ops aiocb32_ops = { .fetch_error = aiocb32_fetch_error, .store_status = aiocb32_store_status, .store_error = aiocb32_store_error, - .store_kernelinfo = aiocb32_store_kernelinfo, .store_aiocb = aiocb32_store_aiocb, }; @@ -2919,7 +2880,6 @@ static struct aiocb_ops aiocb32_ops_osigevent = { .fetch_error = aiocb32_fetch_error, .store_status = aiocb32_store_status, .store_error = aiocb32_store_error, - .store_kernelinfo = aiocb32_store_kernelinfo, .store_aiocb = aiocb32_store_aiocb, }; #endif diff --git a/sys/sys/aio.h b/sys/sys/aio.h index 919a6180b130..e979e0105e68 100644 --- a/sys/sys/aio.h +++ b/sys/sys/aio.h @@ -97,7 +97,7 @@ struct __aiocb_private { long status; long error; - void *kernelinfo; + void *spare; }; /*