FAILED: patch "[PATCH] memremap: fix softlockup reports at teardown" failed to apply to 4.14-stable tree
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
949b93250a566cc7a578b4f829cf76b70d19a62cMon Sep 17 00:00:00 2001
From: Dan Williams <[email protected]>
Date: Tue, 6 Feb 2018 19:34:11 -0800
Subject: [PATCH] memremap: fix softlockup reports at teardown
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The cond_resched() currently in the setup path needs to be duplicated in the teardown path. Rather than require each instance of for_each_device_pfn() to open code the same sequence, embed it in the helper.
kernel/memremap.c +10 -5
@@ -275,8 +275,15 @@ static unsigned long pfn_end(struct dev_pagemap *pgmap)return (res->start +resource_size (res)) >>PAGE_SHIFT ; } +static unsigned long pfn_next (unsigned long pfn) +{ +if (pfn %1024 ==0 ) +cond_resched (); +return pfn +1 ; +} +#define for_each_device_pfn (pfn, map) \ - for (pfn = pfn_first(map); pfn < pfn_end(map); pfn++) + for (pfn = pfn_first(map); pfn < pfn_end(map); pfn = pfn_next(pfn))static void devm_memremap_pages_release (void *data) {
@@ -337,10 +344,10 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)resource_size_t align_start, align_size, align_end;struct vmem_altmap *altmap = pgmap->altmap_valid ? &pgmap->altmap :NULL ; +struct resource *res = &pgmap->res;unsigned long pfn, pgoff, order;pgprot_t pgprot =PAGE_KERNEL ; -int error, nid, is_ram, i =0 ; -struct resource *res = &pgmap->res; +int error, nid, is_ram; align_start = res->start & ~(SECTION_SIZE -1 ); align_size =ALIGN (res->start +resource_size (res),SECTION_SIZE )
@@ -409,8 +416,6 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)list_del (&page->lru); page->pgmap = pgmap;percpu_ref_get (pgmap->ref); -if (!(++i %1024 )) -cond_resched (); }devm_add_action (dev, devm_memremap_pages_release, pgmap);