linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Philip Li <philip.li@intel.com>,
	"David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: <lorenzo.stoakes@oracle.com>, <Liam.Howlett@oracle.com>,
	<vbabka@suse.cz>, <rppt@kernel.org>, <surenb@google.com>,
	<mhocko@suse.com>, <nao.horiguchi@gmail.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<linux-kselftest@vger.kernel.org>, <akpm@linux-foundation.org>,
	<shuah@kernel.org>
Subject: Re: [PATCH 0/3] selftests/mm: add memory failure selftests
Date: Tue, 20 Jan 2026 17:05:05 +0800	[thread overview]
Message-ID: <e62bda7d-4584-3f5d-f1f8-7685ca4d92df@huawei.com> (raw)
In-Reply-To: <aWZRKk92pYvwBLj6@rli9-mobl>

On 2026/1/13 22:05, Philip Li wrote:
> On Mon, Jan 12, 2026 at 08:38:58PM +0100, David Hildenbrand (Red Hat) wrote:
>> On 1/12/26 13:44, Miaohe Lin wrote:
>>> On 2026/1/12 19:33, Miaohe Lin wrote:
> 
> ...
> 
>>>>>>> # # # Starting 6 tests from 2 test cases.
>>>>>>> # # #  RUN           memory_failure.madv_hard.anon ...
>>>>>>> # # #            OK  memory_failure.madv_hard.anon
>>>>>>> # not ok 71 memory-failure # exit=1
>>>>>>>
>>>>>>>
>>>>>>> Can the test maybe not deal with running in certain environments (config options etc)?
>>>>>>
>>>>>> To run the test, I think there should be:
>>>>>>     1.CONFIG_MEMORY_FAILURE and CONFIG_HWPOISON_INJECT should be enabled.
> 
> in 0day env, the configs are below
> 
> CONFIG_MEMORY_FAILURE=y
> CONFIG_HWPOISON_INJECT=m
> 
>>>>>>     2.Root privilege is required.
> 
> yes, use root to run
> 
>>>>>>     3.For dirty/clean pagecache testcases, the test file "./clean-page-cache-test-file" and
>>>>>>       "./dirty-page-cache-test-file" are assumed to be created on non-memory file systems
>>>>>>       such as xfs, ext4, etc.
> 
> this is a problem in 0day, the test is running in tmpfs. Let me further check
> to correct this.
> 
>>>>>>
>>>>>> Does your test environment break any of the above rules?
>>>>>
>>>>> It is 0day environment, so very likely yes. I suspect 1).
>>>
>>> Hi David,
>>>
>>> After taking a more close look, I think CONFIG_MEMORY_FAILURE and CONFIG_HWPOISON_INJECT should have been
>>> enabled in 0day environment or testcase memory_failure.madv_hard.anon should fail. memory_failure.madv_hard.anon
>>> will inject memory failure and expects seeing a SIGBUG signal.
>>
>> Good point.
>>
>>>
>>>>>
>>>>>> Am I expected to add some code to
>>>>>> guard against this?
>>>>>
>>>>> Yes, at least some.
>>>>>
>>>>> Checking for root privileges is not required. The tests are commonly run from non-memory file systems, but, in theory, could be run from nfs etc.
>>>>>
>>>>> If you require special file systems, take a look at gup_longterm.o where we test for some fileystsem types.
>>>
>>> And I think the cause of failures of testcases memory_failure.madv_hard.clean_pagecache and memory_failure.madv_hard.dirty_pagecache
>>> is they running on memory filesystems. The error pages are kept in page cache in that case while memory_failure.madv_hard.clean_pagecache
>>> expects to see the error page truncated.
>>
>> Maybe they are run on shmem? Good question. (@Phil?)
> 
> yes, it runs on tmpfs, let me further check to resolve it.

Thanks both. This information is really helpful. I will add some codes to handle this.

Thanks.
.


      reply	other threads:[~2026-01-20  9:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07  9:37 Miaohe Lin
2026-01-07  9:37 ` [PATCH 1/3] selftests/mm: add memory failure anonymous page test Miaohe Lin
2026-01-07  9:37 ` [PATCH 2/3] selftests/mm: add memory failure clean pagecache test Miaohe Lin
2026-01-07  9:37 ` [PATCH 3/3] selftests/mm: add memory failure dirty " Miaohe Lin
2026-01-09 13:45 ` [PATCH 0/3] selftests/mm: add memory failure selftests David Hildenbrand (Red Hat)
2026-01-12  9:19   ` Miaohe Lin
2026-01-12  9:40     ` David Hildenbrand (Red Hat)
2026-01-12 11:33       ` Miaohe Lin
2026-01-12 12:44         ` Miaohe Lin
2026-01-12 19:38           ` David Hildenbrand (Red Hat)
2026-01-13 14:05             ` Philip Li
2026-01-20  9:05               ` Miaohe Lin [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=e62bda7d-4584-3f5d-f1f8-7685ca4d92df@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=nao.horiguchi@gmail.com \
    --cc=philip.li@intel.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /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