All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-mm@kvack.org, jaegeuk@kernel.org,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{, de}compress_ctx
Date: Tue, 13 May 2025 14:34:25 +0800	[thread overview]
Message-ID: <ba2bc9bf-7cec-4871-b603-8130c84fc917@kernel.org> (raw)
In-Reply-To: <aCLgPLUiFsiCzSBK@infradead.org>

On 5/13/25 14:01, Christoph Hellwig wrote:
> On Tue, May 13, 2025 at 01:57:20PM +0800, Chao Yu wrote:
>> .init_{,de}compress_ctx uses kvmalloc() to alloc memory, it will try
>> to allocate physically continuous page first, it may cause more memory
>> allocation pressure, let's use vmalloc instead to mitigate it.
> 
> Shouldn't this be handled in kvmalloc instead of working around it in
> callers?

kvmalloc() will allocate physically continuous page first, so it may race
w/ other physically continuous page allocator who uses kmalloc(), in
scenario of there are few physically continuous pages.

Thanks,



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: chao@kernel.org, jaegeuk@kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{,de}compress_ctx
Date: Tue, 13 May 2025 14:34:25 +0800	[thread overview]
Message-ID: <ba2bc9bf-7cec-4871-b603-8130c84fc917@kernel.org> (raw)
In-Reply-To: <aCLgPLUiFsiCzSBK@infradead.org>

On 5/13/25 14:01, Christoph Hellwig wrote:
> On Tue, May 13, 2025 at 01:57:20PM +0800, Chao Yu wrote:
>> .init_{,de}compress_ctx uses kvmalloc() to alloc memory, it will try
>> to allocate physically continuous page first, it may cause more memory
>> allocation pressure, let's use vmalloc instead to mitigate it.
> 
> Shouldn't this be handled in kvmalloc instead of working around it in
> callers?

kvmalloc() will allocate physically continuous page first, so it may race
w/ other physically continuous page allocator who uses kmalloc(), in
scenario of there are few physically continuous pages.

Thanks,



  reply	other threads:[~2025-05-13  6:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  5:57 [f2fs-dev] [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{, de}compress_ctx Chao Yu via Linux-f2fs-devel
2025-05-13  5:57 ` [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{,de}compress_ctx Chao Yu
2025-05-13  5:57 ` [f2fs-dev] [PATCH 2/2] f2fs: introduce FAULT_VMALLOC Chao Yu via Linux-f2fs-devel
2025-05-13  5:57   ` Chao Yu
2025-05-13  6:01 ` [f2fs-dev] [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{, de}compress_ctx Christoph Hellwig
2025-05-13  6:01   ` [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{,de}compress_ctx Christoph Hellwig
2025-05-13  6:34   ` Chao Yu via Linux-f2fs-devel [this message]
2025-05-13  6:34     ` Chao Yu
2025-05-14 15:40 ` [f2fs-dev] [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{, de}compress_ctx patchwork-bot+f2fs--- via Linux-f2fs-devel
2025-05-14 15:40   ` patchwork-bot+f2fs

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=ba2bc9bf-7cec-4871-b603-8130c84fc917@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=hch@infradead.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.