* [PATCH] mm/vunmap: Add cond_resched() in vunmap_pmd_range
@ 2020-08-07 7:59 Aneesh Kumar K.V
2020-08-11 4:46 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Aneesh Kumar K.V @ 2020-08-07 7:59 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, Aneesh Kumar K.V, Harish Sriram
Like zap_pte_range add cond_resched so that we can avoid softlockups as reported
below. On non-preemptible kernel with large I/O map region (like the one we get
when using persistent memory with sector mode), an unmap of the namespace can report
below softlockups.
22724.027334] watchdog: BUG: soft lockup - CPU#49 stuck for 23s! [ndctl:50777]
NIP [c0000000000dc224] plpar_hcall+0x38/0x58
LR [c0000000000d8898] pSeries_lpar_hpte_invalidate+0x68/0xb0
Call Trace:
[c0000004e87a7780] [c0000004fb197c00] 0xc0000004fb197c00 (unreliable)
[c0000004e87a7810] [c00000000007f4e4] flush_hash_page+0x114/0x200
[c0000004e87a7890] [c0000000000833cc] hpte_need_flush+0x2dc/0x540
[c0000004e87a7950] [c0000000003f5798] vunmap_page_range+0x538/0x6f0
[c0000004e87a7a70] [c0000000003f76d0] free_unmap_vmap_area+0x30/0x70
[c0000004e87a7aa0] [c0000000003f7a6c] remove_vm_area+0xfc/0x140
[c0000004e87a7ad0] [c0000000003f7dd8] __vunmap+0x68/0x270
[c0000004e87a7b50] [c000000000079de4] __iounmap.part.0+0x34/0x60
[c0000004e87a7bb0] [c000000000376394] memunmap+0x54/0x70
[c0000004e87a7bd0] [c000000000881d7c] release_nodes+0x28c/0x300
[c0000004e87a7c40] [c00000000087a65c] device_release_driver_internal+0x16c/0x280
[c0000004e87a7c80] [c000000000876fc4] unbind_store+0x124/0x170
[c0000004e87a7cd0] [c000000000875be4] drv_attr_store+0x44/0x60
[c0000004e87a7cf0] [c00000000057c734] sysfs_kf_write+0x64/0x90
[c0000004e87a7d10] [c00000000057bc10] kernfs_fop_write+0x1b0/0x290
[c0000004e87a7d60] [c000000000488e6c] __vfs_write+0x3c/0x70
[c0000004e87a7d80] [c00000000048c868] vfs_write+0xd8/0x260
[c0000004e87a7dd0] [c00000000048ccac] ksys_write+0xdc/0x130
[c0000004e87a7e20] [c00000000000b588] system_call+0x5c/0x70
Reported-by: Harish Sriram <harish@linux.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
mm/vmalloc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 5a2b55c8dd9a..128d20d2d6cb 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -102,6 +102,8 @@ static void vunmap_pmd_range(pud_t *pud, unsigned long addr, unsigned long end,
if (pmd_none_or_clear_bad(pmd))
continue;
vunmap_pte_range(pmd, addr, next, mask);
+
+ cond_resched();
} while (pmd++, addr = next, addr != end);
}
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/vunmap: Add cond_resched() in vunmap_pmd_range
2020-08-07 7:59 [PATCH] mm/vunmap: Add cond_resched() in vunmap_pmd_range Aneesh Kumar K.V
@ 2020-08-11 4:46 ` Andrew Morton
2020-08-11 8:47 ` Aneesh Kumar K.V
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2020-08-11 4:46 UTC (permalink / raw)
To: Aneesh Kumar K.V; +Cc: linux-mm, Harish Sriram
On Fri, 7 Aug 2020 13:29:33 +0530 "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
> Like zap_pte_range add cond_resched so that we can avoid softlockups as reported
> below. On non-preemptible kernel with large I/O map region (like the one we get
> when using persistent memory with sector mode), an unmap of the namespace can report
> below softlockups.
>
> ...
>
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -102,6 +102,8 @@ static void vunmap_pmd_range(pud_t *pud, unsigned long addr, unsigned long end,
> if (pmd_none_or_clear_bad(pmd))
> continue;
> vunmap_pte_range(pmd, addr, next, mask);
> +
> + cond_resched();
> } while (pmd++, addr = next, addr != end);
> }
That looks sane. I'll aim for merging it in 5.9-rc2ish, with a
cc:stable, OK?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/vunmap: Add cond_resched() in vunmap_pmd_range
2020-08-11 4:46 ` Andrew Morton
@ 2020-08-11 8:47 ` Aneesh Kumar K.V
0 siblings, 0 replies; 3+ messages in thread
From: Aneesh Kumar K.V @ 2020-08-11 8:47 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, Harish Sriram
On 8/11/20 10:16 AM, Andrew Morton wrote:
> On Fri, 7 Aug 2020 13:29:33 +0530 "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
>
>> Like zap_pte_range add cond_resched so that we can avoid softlockups as reported
>> below. On non-preemptible kernel with large I/O map region (like the one we get
>> when using persistent memory with sector mode), an unmap of the namespace can report
>> below softlockups.
>>
>> ...
>>
>> --- a/mm/vmalloc.c
>> +++ b/mm/vmalloc.c
>> @@ -102,6 +102,8 @@ static void vunmap_pmd_range(pud_t *pud, unsigned long addr, unsigned long end,
>> if (pmd_none_or_clear_bad(pmd))
>> continue;
>> vunmap_pte_range(pmd, addr, next, mask);
>> +
>> + cond_resched();
>> } while (pmd++, addr = next, addr != end);
>> }
>
> That looks sane. I'll aim for merging it in 5.9-rc2ish, with a
> cc:stable, OK?
>
Sure. I was not so particular about stable because it was only a
softlockup warning.
-aneesh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-11 8:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 7:59 [PATCH] mm/vunmap: Add cond_resched() in vunmap_pmd_range Aneesh Kumar K.V
2020-08-11 4:46 ` Andrew Morton
2020-08-11 8:47 ` Aneesh Kumar K.V
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).