* + mm-vmalloc-replace-bug_on-by-warn_on_once.patch added to mm-unstable branch
@ 2022-12-22 21:38 Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2022-12-22 21:38 UTC (permalink / raw)
To: mm-commits, willy, roman.gushchin, oleksiy.avramchenko, npiggin,
lstoakes, hch, hch, bhe, urezki, akpm
The patch titled
Subject: mm: vmalloc: replace BUG_ON() by WARN_ON_ONCE()
has been added to the -mm mm-unstable branch. Its filename is
mm-vmalloc-replace-bug_on-by-warn_on_once.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmalloc-replace-bug_on-by-warn_on_once.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: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Subject: mm: vmalloc: replace BUG_ON() by WARN_ON_ONCE()
Date: Thu, 22 Dec 2022 20:00:22 +0100
Currently a vm_unmap_ram() functions triggers a BUG() if an area is not
found. Replace it by the WARN_ON_ONCE() error message and keep machine
alive instead of stopping it.
The worst case is a memory leaking.
Link: https://lkml.kernel.org/r/20221222190022.134380-3-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
--- a/mm/vmalloc.c~mm-vmalloc-replace-bug_on-by-warn_on_once
+++ a/mm/vmalloc.c
@@ -2253,7 +2253,9 @@ void vm_unmap_ram(const void *mem, unsig
}
va = find_unlink_vmap_area(addr);
- BUG_ON(!va);
+ if (WARN_ON_ONCE(!va))
+ return;
+
debug_check_no_locks_freed((void *)va->va_start,
(va->va_end - va->va_start));
free_unmap_vmap_area(va);
_
Patches currently in -mm which might be from urezki@gmail.com are
mm-vmalloc-avoid-calling-__find_vmap_area-twice-in-__vunmap.patch
mm-vmalloc-switch-to-find_unlink_vmap_area-in-vm_unmap_ram.patch
mm-vmalloc-replace-bug_on-by-warn_on_once.patch
^ permalink raw reply [flat|nested] 2+ messages in thread* + mm-vmalloc-replace-bug_on-by-warn_on_once.patch added to mm-unstable branch
@ 2022-12-21 21:23 Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2022-12-21 21:23 UTC (permalink / raw)
To: mm-commits, willy, roman.gushchin, oleksiy.avramchenko, npiggin,
lstoakes, hch, bhe, urezki, akpm
The patch titled
Subject: mm: vmalloc: replace BUG_ON() by WARN_ON_ONCE()
has been added to the -mm mm-unstable branch. Its filename is
mm-vmalloc-replace-bug_on-by-warn_on_once.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmalloc-replace-bug_on-by-warn_on_once.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: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Subject: mm: vmalloc: replace BUG_ON() by WARN_ON_ONCE()
Date: Wed, 21 Dec 2022 18:44:54 +0100
Currently a vm_unmap_ram() functions triggers a BUG() if an area
is not found. Replace it by the WARN_ON_ONCE() error message and
keep machine alive instead of stopping it.
The worst case is a memory leaking.
Link: https://lkml.kernel.org/r/20221221174454.1085130-3-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/vmalloc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/mm/vmalloc.c~mm-vmalloc-replace-bug_on-by-warn_on_once
+++ a/mm/vmalloc.c
@@ -2252,7 +2252,9 @@ void vm_unmap_ram(const void *mem, unsig
}
va = find_unlink_vmap_area(addr);
- BUG_ON(!va);
+ if (WARN_ON_ONCE(!va))
+ return;
+
debug_check_no_locks_freed((void *)va->va_start,
(va->va_end - va->va_start));
free_unmap_vmap_area(va);
_
Patches currently in -mm which might be from urezki@gmail.com are
mm-vmalloc-avoid-of-calling-__find_vmap_area-twise-in-__vunmap.patch
mm-vmalloc-switch-to-find_unlink_vmap_area-in-vm_unmap_ram.patch
mm-vmalloc-replace-bug_on-by-warn_on_once.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-22 21:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-22 21:38 + mm-vmalloc-replace-bug_on-by-warn_on_once.patch added to mm-unstable branch Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2022-12-21 21:23 Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.