da <masahi...@kernel.org>, Jarkko Sakkinen <jar...@profian.com>, Sami Tolvanen <samitolva...@google.com>, "Naveen N. Rao" <naveen.n....@linux.ibm.com>, Marco Elver <el...@google.com>, Kees Cook <keesc...@chromium.org>, Steven Rostedt <rost...@goodmis.org>, Nathan Chancellor <nat...@kernel.org>, "Russell King \(Oracle\)" <rmk+ker...@armlinux.org.uk>, Mark Brown <broo...@kernel.org>, Borislav Petkov <b...@alien8.de>, Alexander Egorenkov <egore...@linux.ibm.com>, Thomas Bogendoerfer <tsbog...@alpha.franken.de>, Parisc List <linux-par...@vger.kernel.org>, Nathaniel McCallum <nathan...@profian.com>, Dmitry Torokhov <dmitry.torok...@gmail.com>, "David S. Miller" <da...@davemloft.net>, "Kirill A. Shutemov" <kirill.shute...@linux.intel.com>, Tobias Huschle <husc...@linux.ibm.com>, "Peter Zijlstra \(Intel\)" <pet...@infradead.org>, "H. Peter Anvin" <h...@zytor.com>, sparclinux <sparcli...@vger.kernel.org>, Tiezhu Yang <yangtie...@loongson.cn>, Miroslav Benes <mbe...@suse.cz>, Chen Zhongjin <chen zhong...@huawei.com>, Ard Biesheuvel <a...@kernel.org>, the arch/x86 maintainers <x...@kernel.org>, Russell King <li...@armlinux.org.uk>, linux-riscv <linux-ri...@lists.infradead.org>, Ingo Molnar <mi...@redhat.com>, Aaron Tomlin <atom...@redhat.com>, Albert Ou <a...@eecs.berkeley.edu>, Heiko Carstens <h...@linux.ibm.com>, Liao Chang <liaocha...@huawei.com>, Paul Walmsley <paul.walms...@sifive.com>, Josh Poimboeuf <jpoim...@kernel.org>, Thomas Richter <tmri...@linux.ibm.com>, "open list:BROADCOM NVRAM DRIVER" <linux-m...@vger.kernel.org>, Changbin Du <changbin...@intel.com>, Palmer Dabbelt <pal...@dabbelt.com>, linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, linux-modu...@vger.kernel.org Errors-To: linuxppc-dev-bounces+archive=mail-archive....@lists.ozlabs.org Sender: "Linuxppc-dev" <linuxppc-dev-bounces+archive=mail-archive....@lists.ozlabs.org>
On Wed, Jun 08, 2022 at 11:20:53AM -0700, Song Liu wrote: > On Wed, Jun 8, 2022 at 9:12 AM Song Liu <s...@kernel.org> wrote: > > On Wed, Jun 8, 2022 at 7:21 AM Masami Hiramatsu <mhira...@kernel.org> wrote: > > > On Wed, 8 Jun 2022 08:25:38 +0300 > > > Jarkko Sakkinen <jar...@kernel.org> wrote: > > > > On Wed, Jun 08, 2022 at 10:35:42AM +0800, Guo Ren wrote: > > > > > On Wed, Jun 8, 2022 at 8:02 AM Jarkko Sakkinen <jar...@profian.com> > > > > > wrote: > > > > > > As the result, kprobes can be used with a monolithic kernel. > > > > > It's strange when MODULES is n, but vmlinux still obtains > > > > > module_alloc. > > > > > > > > > > Maybe we need a kprobe_alloc, right? > > > > > > > > Perhaps not the best name but at least it documents the fact that > > > > they use the same allocator. > > > > > > > > Few years ago I carved up something "half-way there" for kprobes, > > > > and I used the name text_alloc() [*]. > > > > > > > > [*] > > > > https://lore.kernel.org/all/20200724050553.1724168-1-jarkko.sakki...@linux.intel.com/ > > > > > > Yeah, I remember that. Thank you for updating your patch! > > > I think the idea (split module_alloc() from CONFIG_MODULE) is good to me. > > > If module support maintainers think this name is not good, you may be > > > able to rename it as text_alloc() and make the module_alloc() as a > > > wrapper of it. > > > > IIUC, most users of module_alloc() use it to allocate memory for text, > > except > > that module code uses it for both text and data. Therefore, I guess calling > > it > > text_alloc() is not 100% accurate until we change the module code (to use > > a different API to allocate memory for data). > > Git history showed me > > 7a0e27b2a0ce mm: remove vmalloc_exec > > I guess we are somehow going back in time... No, that was removed because it has only one user. The real hard work to generalize vmalloc_exec() with all the arch special sauce was not done. To do this properly architectures must be able to override it. We can use the old vmalloc_exec() or text_alloc(). I think vmalloc_exec() is more in line with mm stuff, but it would be our first __weak mm call from what I can tell. Anyway patches welcomed. Luis