Linux Modules
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Petr Pavlu <petr.pavlu@suse.com>,
	Prarit Bhargava <prarit@redhat.com>,
	David Hildenbrand <david@redhat.com>
Cc: pmladek@suse.com, linux-modules@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/4] selftests: kmod: Add tests for merging same-name module load requests
Date: Tue, 25 Oct 2022 16:01:53 -0700	[thread overview]
Message-ID: <Y1hq4UT5qXROyLka@bombadil.infradead.org> (raw)
In-Reply-To: <Y1giEusr0/sGNrGC@bombadil.infradead.org>

On Tue, Oct 25, 2022 at 10:51:14AM -0700, Luis Chamberlain wrote:
> On Sun, Oct 16, 2022 at 02:30:31PM +0200, Petr Pavlu wrote:
> > diff --git a/tools/testing/selftests/kmod/init_module.c b/tools/testing/selftests/kmod/init_module.c
> > @@ -525,6 +662,8 @@ list_tests()
> >  	echo "0011 x $(get_test_count 0011) - test completely disabling module autoloading"
> >  	echo "0012 x $(get_test_count 0012) - test /proc/modules address visibility under CAP_SYSLOG"
> >  	echo "0013 x $(get_test_count 0013) - test /sys/module/*/sections/* visibility under CAP_SYSLOG"
> > +	echo "0014 x $(get_test_count 0014) - test handling of parallel loads, success case"
> > +	echo "0015 x $(get_test_count 0015) - test handling of parallel loads, init returning error"
> 
> Good stuff!
> 
> So test 0015 mimics the error reported by Prarit Bhargava through
> commit 6e6de3dee51a ("kernel/module.c: Only return -EEXIST for modules
> that have finished loading")? If so it would be good to document that
> here.
> 
> Also, this patch should go first, with the ALL_TESTS variable set to
> disable the tests which are known to fail, so to demonstrate the *new*
> issues as they are failing and then your fix first and then you enable
> that test afterwards.
> 
> If 6e6de3dee51a introduced another regression which is not covered
> by the tests we'd add it, and fix on top of it as a stepping stone
> to prove / send to stable.

On second though, this could also be made into a self-contained C code
test within lib/test_kmod.c:

  * You'd extend kmod_test_case with a new enum, say TEST_KMOD_INIT_RACES
  * You could extend run_request() to run the series of tests required.
  * request_module() does not allow you to specify module parameters,
    but we could have optional support added, and make the existing
    request_module() always pass that empty / NULL.

Kind of like lib/test_vmalloc.c which has an array of tests, you can peg
new tests to the TEST_KMOD_INIT_RACES for it.

Let me know what folks think.

  Luis

      reply	other threads:[~2022-10-25 23:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 12:30 [PATCH v3 0/4] module: Merge same-name module load requests Petr Pavlu
2022-10-16 12:30 ` [PATCH v3 1/4] module: Correct wake up of module_wq Petr Pavlu
2022-10-17  7:26   ` David Hildenbrand
2022-10-16 12:30 ` [PATCH v3 2/4] module: Update a comment describing what is protected by module_mutex Petr Pavlu
2022-10-17  7:27   ` David Hildenbrand
2022-10-17 12:22   ` Petr Mladek
2022-10-16 12:30 ` [PATCH v3 3/4] module: Merge same-name module load requests Petr Pavlu
2022-10-17  7:43   ` David Hildenbrand
2022-10-18  8:52     ` Petr Pavlu
2022-10-18  9:18       ` David Hildenbrand
2022-10-17 12:54   ` Petr Mladek
2022-10-16 12:30 ` [PATCH v3 4/4] selftests: kmod: Add tests for merging " Petr Pavlu
2022-10-17 13:51   ` Petr Mladek
2023-01-12  9:03     ` Petr Pavlu
2023-01-13 14:45       ` Petr Mladek
2022-10-25 17:51   ` Luis Chamberlain
2022-10-25 23:01     ` Luis Chamberlain [this message]

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=Y1hq4UT5qXROyLka@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=pmladek@suse.com \
    --cc=prarit@redhat.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