mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] erofs: shorten bvecs[] for file-backed mounts
@ 2025-01-07  8:28 Gao Xiang
  2025-01-16  8:29 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Gao Xiang @ 2025-01-07  8:28 UTC (permalink / raw)
  To: linux-erofs; +Cc: linux-kernel, Gao Xiang

BIO_MAX_VECS is too large for __GFP_NOFAIL allocation. We could use
a mempool (since BIO can always proceed), but it seems overly
complicated for now.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/fileio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/erofs/fileio.c b/fs/erofs/fileio.c
index 33f8539dda4a..0ffd1c63beeb 100644
--- a/fs/erofs/fileio.c
+++ b/fs/erofs/fileio.c
@@ -6,7 +6,7 @@
 #include <trace/events/erofs.h>
 
 struct erofs_fileio_rq {
-	struct bio_vec bvecs[BIO_MAX_VECS];
+	struct bio_vec bvecs[16];
 	struct bio bio;
 	struct kiocb iocb;
 	struct super_block *sb;
@@ -68,7 +68,7 @@ static struct erofs_fileio_rq *erofs_fileio_rq_alloc(struct erofs_map_dev *mdev)
 	struct erofs_fileio_rq *rq = kzalloc(sizeof(*rq),
 					     GFP_KERNEL | __GFP_NOFAIL);
 
-	bio_init(&rq->bio, NULL, rq->bvecs, BIO_MAX_VECS, REQ_OP_READ);
+	bio_init(&rq->bio, NULL, rq->bvecs, ARRAY_SIZE(rq->bvecs), REQ_OP_READ);
 	rq->iocb.ki_filp = mdev->m_dif->file;
 	rq->sb = mdev->m_sb;
 	return rq;
-- 
2.43.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] erofs: shorten bvecs[] for file-backed mounts
  2025-01-07  8:28 [PATCH] erofs: shorten bvecs[] for file-backed mounts Gao Xiang
@ 2025-01-16  8:29 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2025-01-16  8:29 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs; +Cc: chao, linux-kernel

On 1/7/25 16:28, Gao Xiang wrote:
> BIO_MAX_VECS is too large for __GFP_NOFAIL allocation. We could use
> a mempool (since BIO can always proceed), but it seems overly
> complicated for now.
> 
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-16  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-07  8:28 [PATCH] erofs: shorten bvecs[] for file-backed mounts Gao Xiang
2025-01-16  8:29 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®