All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] madvise11.c:Check loadable module before rmmod
Date: Mon, 13 Mar 2023 09:46:24 -0400	[thread overview]
Message-ID: <20230313134624.GA9783@localhost> (raw)
In-Reply-To: <ZA8Y+O7QFfVB0/62@yuki>

On Mon, Mar 13, 2023 at 01:37:12PM +0100, Cyril Hrubis wrote:
> Hi!
> > > That does not solve the problem completely though, if we have a kernel
> > > where the hwpoinson_inject is set to N in config the test will attempt
> > > to rmmod it and get different error.
> > 
> > 
> > I have tested on the kernel which set to N in config and the test will report:
> > tst_test.c:1180: TCONF: hwpoison_inject driver not available
> > 
> > I think it should caused by following configuration of test case:
> >         .needs_drivers = (const char *const []) {
> >                 HW_MODULE,
> >                 NULL
> >         },
> > 
> > So the scenario of "N in kernel config" already handled by LTP framework, i have
> > to say LTP frame work already do a lot of things which i have no idea... xD
> 
> Ah, missed that part as well.
> 
> Looking at lib/tst_kernel.c we can also easily add tst_buildin_driver()
> function into the LTP library with just:
> 
> diff --git a/lib/tst_kernel.c b/lib/tst_kernel.c
> index ecf4b917e..6000522b7 100644
> --- a/lib/tst_kernel.c
> +++ b/lib/tst_kernel.c
> @@ -153,6 +153,11 @@ static int tst_check_driver_(const char *driver)
>         return -1;
>  }
> 
> +int tst_buildin_driver(const char *driver)
> +{
> +       return !tst_search_driver(driver, "modules.buildin");
> +}
> +
>  int tst_check_driver(const char *driver)
>  {
>  #ifdef __ANDROID__
> 

Try use above implementation but i found another TWARN : (

localhost:/home/ltp/testcases/kernel/syscalls/madvise # ./madvise11
tst_test.c:1560: TINFO: Timeout per run is 0h 01m 00s
madvise11.c:396: TINFO: Spawning 5 threads, with a total of 800 memory pages
madvise11.c:165: TINFO: Thread [3] returned 0, succeeded.
madvise11.c:165: TINFO: Thread [1] returned 0, succeeded.
madvise11.c:165: TINFO: Thread [2] returned 0, succeeded.
madvise11.c:165: TINFO: Thread [4] returned 0, succeeded.
madvise11.c:165: TINFO: Thread [0] returned 0, succeeded.
madvise11.c:199: TPASS: soft-offline / mmap race still clean
madvise11.c:327: TWARN: open(/sys/kernel/debug/hwpoison/unpoison-pfn,1,0000) failed: ENOENT (2) !!!!


> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-03-13 13:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 14:04 [LTP] [PATCH v1] madvise11.c:Check loadable module before rmmod Wei Gao via ltp
2023-03-10 14:52 ` Cyril Hrubis
2023-03-11  2:23   ` Wei Gao via ltp
2023-03-12  0:47     ` Wei Gao via ltp
2023-03-13  8:55     ` Cyril Hrubis
2023-03-10 14:53 ` Cyril Hrubis
2023-03-11  2:35   ` Wei Gao via ltp
2023-03-11  2:33 ` [LTP] [PATCH v2] " Wei Gao via ltp
2023-03-12  0:44   ` [LTP] [PATCH v3] " Wei Gao via ltp
2023-03-13  9:19     ` Cyril Hrubis
2023-03-13 12:21       ` Wei Gao via ltp
2023-03-13 12:37         ` Cyril Hrubis
2023-03-13 13:46           ` Wei Gao via ltp [this message]
2023-03-13 14:06             ` Cyril Hrubis
2023-03-14  5:31               ` Wei Gao via ltp
2023-03-14  8:15                 ` Cyril Hrubis
2023-03-14  8:49                   ` Richard Palethorpe
2023-03-14  9:15                     ` Cyril Hrubis
2023-03-14 13:10                       ` Richard Palethorpe
2023-03-14  9:43                   ` Wei Gao via ltp
2023-03-13 13:41     ` [LTP] [PATCH v4] " Wei Gao via ltp
2023-03-14  9:37       ` [LTP] [PATCH v5] " Wei Gao via ltp
2023-03-21 16:50         ` Petr Vorel
2023-03-23  9:47         ` Cyril Hrubis
2023-03-23 12:10         ` [LTP] [PATCH v6 0/2] madvise11: Check if module is loadable " Wei Gao via ltp
2023-03-23 12:10           ` [LTP] [PATCH v6 1/2] tst_kernel: Add function check if the kernel module is built-in Wei Gao via ltp
2023-03-24  5:51             ` Petr Vorel
2023-03-23 12:10           ` [LTP] [PATCH v6 2/2] madvise11: Check if module is loadable before rmmod Wei Gao via ltp

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=20230313134624.GA9783@localhost \
    --to=ltp@lists.linux.it \
    --cc=chrubis@suse.cz \
    --cc=wegao@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.