linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	gaoxu <gaoxu2@honor.com>,  Dennis Zhou <dennis@kernel.org>,
	Christoph Lameter <cl@linux.com>,
	 "linux-mm@kvack.org" <linux-mm@kvack.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	yipengxiang <yipengxiang@honor.com>
Subject: Re: mm: percpu: increase PERCPU_MODULE_RESERVE to avoid allocation failure
Date: Wed, 23 Apr 2025 10:04:09 -0700	[thread overview]
Message-ID: <CAJuCfpHSYz6-VtR2Q_44eEeCYb=rXcVApKiCZckQwU2X3eEa-A@mail.gmail.com> (raw)
In-Reply-To: <aAkDRg0Ajl3ByXMq@slm.duckdns.org>

On Wed, Apr 23, 2025 at 8:12 AM Tejun Heo <tj@kernel.org> wrote:
>
> On Tue, Apr 22, 2025 at 05:19:31PM -0700, Suren Baghdasaryan wrote:
> ...
> > Allocating this reserved area dynamically would be ideal. OTOH this
> > change increases the area size from 64kb to 128kb. Don't know how much
> > effort we should put into it.
>
> The easiest solution would be switching the modules to use alloc_percpu()
> instead of declaring per-cpu variables statically. I couldn't think of a
> better way to support static percpu variables in modules and still can't,
> but there aren't noticeable downsides to using dynamically allocated percpu
> variables, so if you have several bytes here and there, sure, declare them
> statically, but for anything chunky, please use dynamic allocations.

In case of allocation tags, we are trying to minimize performance
overhead as much as possible and allocating their per-cpu counters at
compile time is in line with that goal. I'll check how much overhead
dynamic allocation would add but it won't be zero.

>
> Thanks.
>
> --
> tejun


  reply	other threads:[~2025-04-23 17:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 11:39 gaoxu
2025-04-23  0:02 ` Andrew Morton
2025-04-23  0:19   ` Suren Baghdasaryan
2025-04-23 15:12     ` Tejun Heo
2025-04-23 17:04       ` Suren Baghdasaryan [this message]
2025-04-23  1:17   ` Dennis Zhou

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='CAJuCfpHSYz6-VtR2Q_44eEeCYb=rXcVApKiCZckQwU2X3eEa-A@mail.gmail.com' \
    --to=surenb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dennis@kernel.org \
    --cc=gaoxu2@honor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    --cc=yipengxiang@honor.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox