+ memory-tier-fix-deadlock-warning-while-onlining-pages-v2.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: memory tier: fix deadlock warning while onlining pages
has been added to the -mm mm-unstable branch.  Its filename is
     memory-tier-fix-deadlock-warning-while-onlining-pages-v2.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/memory-tier-fix-deadlock-warning-while-onlining-pages-v2.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Yanfei Xu <yanfei.xu@xxxxxxxxx>
Subject: memory tier: fix deadlock warning while onlining pages
Date: Fri, 30 Aug 2024 18:24:47 +0800

Add the mutex_lock/unlock() pair back and exclude the
hotplug_memory_notifier() from the locked region, per Ying Huang.

Link: https://lkml.kernel.org/r/20240830102447.1445296-1-yanfei.xu@xxxxxxxxx
Fixes: 823430c8e9d9 ("memory tier: consolidate the initialization of memory tiers")
Signed-off-by: Yanfei Xu <yanfei.xu@xxxxxxxxx>
Cc: Ho-Ren (Jack) Chuang <horen.chuang@xxxxxxxxx>
Cc: "Huang, Ying" <ying.huang@xxxxxxxxx>
Cc: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/memory-tiers.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/mm/memory-tiers.c~memory-tier-fix-deadlock-warning-while-onlining-pages-v2
+++ a/mm/memory-tiers.c
@@ -914,12 +914,14 @@ static int __init memory_tier_init(void)
 	WARN_ON(!node_demotion);
 #endif
 
+	mutex_lock(&memory_tier_lock);
 	/*
 	 * For now we can have 4 faster memory tiers with smaller adistance
 	 * than default DRAM tier.
 	 */
 	default_dram_type = mt_find_alloc_memory_type(MEMTIER_ADISTANCE_DRAM,
 						      &default_memory_types);
+	mutex_unlock(&memory_tier_lock);
 	if (IS_ERR(default_dram_type))
 		panic("%s() failed to allocate default DRAM tier\n", __func__);
 
_

Patches currently in -mm which might be from yanfei.xu@xxxxxxxxx are

memory-tier-fix-deadlock-warning-while-onlining-pages.patch
memory-tier-fix-deadlock-warning-while-onlining-pages-v2.patch





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux