[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a57e4eb8-329b-4503-bcd8-892ef44d8194@kadam.mountain>
Date: Fri, 27 Oct 2023 15:27:23 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, Joey Jiao <quic_jiangenj@...cinc.com>,
linux-modules@...r.kernel.org
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
quic_likaid@...cinc.com, Luis Chamberlain <mcgrof@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5] module: Add CONFIG_MODULE_DISABLE_INIT_FREE option
On Fri, Oct 27, 2023 at 03:00:00PM +0300, Dan Carpenter wrote:
> 607c543f939d8c kernel/module.c Andrii Nakryiko 2020-11-20 2579 #ifdef CONFIG_DEBUG_INFO_BTF_MODULES
> 607c543f939d8c kernel/module.c Andrii Nakryiko 2020-11-20 2580 /* .BTF is not SHF_ALLOC and will get removed, so sanitize pointer */
> 607c543f939d8c kernel/module.c Andrii Nakryiko 2020-11-20 2581 mod->btf_data = NULL;
> 607c543f939d8c kernel/module.c Andrii Nakryiko 2020-11-20 2582 #endif
> c749637909eea5 kernel/module.c Rusty Russell 2015-01-20 2583 /*
> c749637909eea5 kernel/module.c Rusty Russell 2015-01-20 2584 * We want to free module_init, but be aware that kallsyms may be
> 0be964be0d4508 kernel/module.c Peter Zijlstra 2015-05-27 2585 * walking this with preempt disabled. In all the failure paths, we
> cb2f55369d3a9e kernel/module.c Paul E. McKenney 2018-11-06 2586 * call synchronize_rcu(), but we don't want to slow down the success
> 1a7b7d9220819a kernel/module.c Rick Edgecombe 2019-04-25 2587 * path. module_memfree() cannot be called in an interrupt, so do the
> 1a7b7d9220819a kernel/module.c Rick Edgecombe 2019-04-25 2588 * work and call synchronize_rcu() in a work queue.
> 1a7b7d9220819a kernel/module.c Rick Edgecombe 2019-04-25 2589 *
> ae646f0b9ca135 kernel/module.c Jeffrey Hugo 2018-05-11 2590 * Note that module_alloc() on most architectures creates W+X page
> ae646f0b9ca135 kernel/module.c Jeffrey Hugo 2018-05-11 2591 * mappings which won't be cleaned up until do_free_init() runs. Any
> ae646f0b9ca135 kernel/module.c Jeffrey Hugo 2018-05-11 2592 * code such as mark_rodata_ro() which depends on those mappings to
> ae646f0b9ca135 kernel/module.c Jeffrey Hugo 2018-05-11 2593 * be cleaned up needs to sync with the queued work - ie
> cb2f55369d3a9e kernel/module.c Paul E. McKenney 2018-11-06 2594 * rcu_barrier()
> c749637909eea5 kernel/module.c Rusty Russell 2015-01-20 2595 */
> 36022a47582048 kernel/module/main.c Joey Jiao 2023-10-13 2596 if (!IS_ENABLED(CONFIG_MODULE_DISABLE_INIT_FREE) &&
> 36022a47582048 kernel/module/main.c Joey Jiao 2023-10-13 2597 llist_add(&freeinit->node, &init_free_list))
>
> Let's not allocate freeinit if CONFIG_MODULE_DISABLE_INIT_FREE is not
> enabled.
Wait. It's the other way around actually. freeinit isn't used if
CONFIG_MODULE_DISABLE_INIT_FREE is enabled.
regards,
dan carpenter
Powered by blists - more mailing lists