LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: wangyangbo <wangyangbo@uniontech.com>
To: axboe@kernel.dk
Cc: asml.silence@gmail.com, io-uring@vger.kernel.org,
	linux-kernel@vger.kernel.org, xiehuanjun@uniontech.com,
	wangyangbo <wangyangbo@uniontech.com>
Subject: [PATCH 1/1] io_uring: Add register support to other PAGE_SIZE
Date: Thu, 19 Aug 2021 13:56:57 +0800	[thread overview]
Message-ID: <20210819055657.27327-1-wangyangbo@uniontech.com> (raw)
In-Reply-To: <24d10cda-445e-10f3-d249-dac254e199e0@kernel.dk>

Now allocated rsrc table uses PAGE_SIZE as the size of 2nd-level, and
accessing this table relies on each level index from fixed TABLE_SHIFT
(12 - 3) in 4k page case. In order to correctly work in non-4k page,
define TABLE_SHIFT as non-fixed (PAGE_SHIFT - shift of data) for
2nd-level table entry number.

Signed-off-by: wangyangbo <wangyangbo@uniontech.com>
---
pleasure to receive comments

 fs/io_uring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 4d5c970eacdb..605b008ba29b 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -92,12 +92,12 @@
 #define IORING_MAX_CQ_ENTRIES	(2 * IORING_MAX_ENTRIES)
 #define IORING_SQPOLL_CAP_ENTRIES_VALUE 8
 
-/* 512 entries per page on 64-bit archs, 64 pages max */
+/* only define max */
 #define IORING_MAX_FIXED_FILES	(1U << 15)
 #define IORING_MAX_RESTRICTIONS	(IORING_RESTRICTION_LAST + \
 				 IORING_REGISTER_LAST + IORING_OP_LAST)
 
-#define IO_RSRC_TAG_TABLE_SHIFT	9
+#define IO_RSRC_TAG_TABLE_SHIFT	(PAGE_SHIFT - 3)
 #define IO_RSRC_TAG_TABLE_MAX	(1U << IO_RSRC_TAG_TABLE_SHIFT)
 #define IO_RSRC_TAG_TABLE_MASK	(IO_RSRC_TAG_TABLE_MAX - 1)
 
-- 
2.20.1




  reply	other threads:[~2021-08-19  5:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210818055613.1655-1-wangyangbo@uniontech.com>
2021-08-18 13:30 ` [PATCH 01/01] " Jens Axboe
2021-08-19  5:56   ` wangyangbo [this message]
2021-08-19 15:54     ` [PATCH 1/1] " Jens Axboe

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=20210819055657.27327-1-wangyangbo@uniontech.com \
    --to=wangyangbo@uniontech.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiehuanjun@uniontech.com \
    --subject='Re: [PATCH 1/1] io_uring: Add register support to other PAGE_SIZE' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).