From: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
To: "yanfei.xu@intel.com" <yanfei.xu@intel.com>
Cc: "Jonathan.Cameron@huawei.com" <Jonathan.Cameron@huawei.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"horen.chuang@linux.dev" <horen.chuang@linux.dev>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"ying.huang@intel.com" <ying.huang@intel.com>
Subject: Re: [PATCH v2] memory tier: fix deadlock warning while onlining pages
Date: Sat, 14 Sep 2024 09:41:49 +0000 [thread overview]
Message-ID: <TY1PR01MB156287A8303EABA99338B8FFA5662@TY1PR01MB1562.jpnprd01.prod.outlook.com> (raw)
> commit 823430c8e9d9 ("memory tier: consolidate the initialization of
> memory tiers") introduces a locking change that use guard(mutex) to
> instead of mutex_lock/unlock() for memory_tier_lock. It unexpectedly
> expanded the locked region to include the hotplug_memory_notifier(),
> as a result, it triggers an locking dependency detected of ABBA
> deadlock. Exclude hotplug_memory_notifier() from the locked region
> to fixing it.
>
> The deadlock scenario is that when a memory online event occurs, the
> execution of memory notifier will access the read lock of the
> memory_chain.rwsem, then the reigistration of the memory notifier in
> memory_tier_init() acquires the write lock of the memory_chain.rwsem
> while holding memory_tier_lock. Then the memory online event continues
> to invoke the memory hotplug callback registered by memory_tier_init().
> Since this callback tries to acquire the memory_tier_lock, a deadlock
> occurs.
[sniped]
I encountered the same message, it works for me. Thanks.
Tested-by: Li Zhijian <lizhijian@fujitsu.com>
next reply other threads:[~2024-09-14 9:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-14 9:41 Zhijian Li (Fujitsu) [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-30 10:24 Yanfei Xu
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=TY1PR01MB156287A8303EABA99338B8FFA5662@TY1PR01MB1562.jpnprd01.prod.outlook.com \
--to=lizhijian@fujitsu.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=horen.chuang@linux.dev \
--cc=linux-mm@kvack.org \
--cc=yanfei.xu@intel.com \
--cc=ying.huang@intel.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