summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2026-02-01 03:12:21 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-02-01 03:12:21 +0300
commit2eec08ff09a416bf04b5716850da73a5084d0500 (patch)
treed8e87cc4cd3092cb3c69220ea468dc4789577cb7 /lib
parent6ca9de3600f482b74723dc13b5e345e4bc3fb3fa (diff)
parentbd58782995a2e6a07fd07255f3cc319f40b131c9 (diff)
downloadlinux-2eec08ff09a416bf04b5716850da73a5084d0500.tar.xz
Merge branch 'mm-hotfixes-stable' into mm-nonmm-stable to pick up changes
required to merge "kho: use unsigned long for nr_pages".
Diffstat (limited to 'lib')
-rw-r--r--lib/flex_proportions.c5
-rw-r--r--lib/test_hmm.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/flex_proportions.c b/lib/flex_proportions.c
index 84ecccddc771..012d5614efb9 100644
--- a/lib/flex_proportions.c
+++ b/lib/flex_proportions.c
@@ -64,13 +64,14 @@ void fprop_global_destroy(struct fprop_global *p)
bool fprop_new_period(struct fprop_global *p, int periods)
{
s64 events = percpu_counter_sum(&p->events);
+ unsigned long flags;
/*
* Don't do anything if there are no events.
*/
if (events <= 1)
return false;
- preempt_disable_nested();
+ local_irq_save(flags);
write_seqcount_begin(&p->sequence);
if (periods < 64)
events -= events >> periods;
@@ -78,7 +79,7 @@ bool fprop_new_period(struct fprop_global *p, int periods)
percpu_counter_add(&p->events, -events);
p->period += periods;
write_seqcount_end(&p->sequence);
- preempt_enable_nested();
+ local_irq_restore(flags);
return true;
}
diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index 8af169d3873a..455a6862ae50 100644
--- a/lib/test_hmm.c
+++ b/lib/test_hmm.c
@@ -662,7 +662,9 @@ static struct page *dmirror_devmem_alloc_page(struct dmirror *dmirror,
goto error;
}
- zone_device_folio_init(page_folio(dpage), order);
+ zone_device_folio_init(page_folio(dpage),
+ page_pgmap(folio_page(page_folio(dpage), 0)),
+ order);
dpage->zone_device_data = rpage;
return dpage;