linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	Youling Tang <youling.tang@linux.dev>,
	Luis Chamberlain <mcgrof@kernel.org>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>, Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	Youling Tang <tangyouling@kylinos.cn>
Subject: Re: [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros
Date: Thu, 25 Jul 2024 08:34:03 -0700	[thread overview]
Message-ID: <ZqJwa2-SsIf0aA_l@infradead.org> (raw)
In-Reply-To: <61beb54b-399b-442d-bfdb-bad23cefa586@app.fastmail.com>

On Thu, Jul 25, 2024 at 05:30:58PM +0200, Arnd Bergmann wrote:
> Now I think we could just make the module_init() macro
> do the same thing as a built-in initcall() and put
> an entry in a special section, to let you have multiple
> entry points in a loadable module.
> 
> There are still at least two problems though:
> 
> - while link order is defined between files in a module,
>   I don't think there is any guarantee for the order between
>   two initcalls of the same level within a single file.

I think the sanest answer is to only allow one per file.  If you
are in the same file anyway calling one function from the other
is not a big burden.  It really is when they are spread over files
when it is annoying, and the three examples show that pretty
clearly.

> - For built-in code we don't have to worry about matching
>   the order of the exit calls since they don't exist there.
>   As I understand, the interesting part of this patch
>   series is about making sure the order matches between
>   init and exit, so there still needs to be a way to
>   express a pair of such calls.

That's why you want a single macro to define the init and exit
callbacks, so that the order can be matched up and so that
error unwinding can use the relative position easily.

  reply	other threads:[~2024-07-25 15:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23  8:32 [PATCH 0/4] Add module_subinit{_noexit} and module_subeixt helper macros Youling Tang
2024-07-23  8:32 ` [PATCH 1/4] module: " Youling Tang
2024-07-23  9:58   ` Mika Penttilä
2024-07-24  1:20     ` Youling Tang
2024-07-23 14:33   ` Christoph Hellwig
2024-07-24  1:57     ` Youling Tang
2024-07-24 15:43       ` Christoph Hellwig
2024-07-25  3:01         ` Youling Tang
2024-07-25 14:39           ` Christoph Hellwig
2024-07-25 15:30             ` Arnd Bergmann
2024-07-25 15:34               ` Christoph Hellwig [this message]
2024-07-25 17:14                 ` Goffredo Baroncelli
2024-07-25 19:46                   ` Christoph Hellwig
2024-07-26  8:54                     ` Youling Tang
2024-07-26 14:04                       ` Christoph Hellwig
2024-07-26 15:22                         ` David Sterba
2024-07-26 17:58                           ` Theodore Ts'o
2024-07-26 18:09                             ` Christoph Hellwig
2024-07-26 22:45                               ` David Sterba
2024-07-27 14:52                               ` Theodore Ts'o
2024-07-29  1:46                                 ` Youling Tang
2024-07-29  2:44                                   ` Theodore Ts'o
2024-07-29  3:01                                     ` Youling Tang
2024-07-29 18:57                                     ` Christoph Hellwig
2024-07-23  8:32 ` [PATCH 2/4] btrfs: Use " Youling Tang
2024-07-23 22:24   ` kernel test robot
2024-07-24  6:29     ` Youling Tang
2024-07-23  8:32 ` [PATCH 3/4] ext4: Use module_{subinit, subexit} " Youling Tang
2024-07-23  8:32 ` [PATCH 4/4] f2fs: Use module_{subinit, subeixt} " Youling Tang
2024-07-23 18:51   ` kernel test robot
2024-07-24  2:14     ` Youling Tang
2024-07-23 21:31   ` kernel test robot

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=ZqJwa2-SsIf0aA_l@infradead.org \
    --to=hch@infradead.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=arnd@arndb.de \
    --cc=chao@kernel.org \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jaegeuk@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=tangyouling@kylinos.cn \
    --cc=tytso@mit.edu \
    --cc=youling.tang@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).