linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lstoakes@gmail.com>
To: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Baoquan He <bhe@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: Re: [PATCH v2 3/3] mm: vmalloc: Replace BUG_ON() by WARN_ON_ONCE()
Date: Wed, 21 Dec 2022 19:13:03 +0000	[thread overview]
Message-ID: <Y6Nav+UHCPPdPO6Q@lucifer> (raw)
In-Reply-To: <20221221174454.1085130-3-urezki@gmail.com>

On Wed, Dec 21, 2022 at 06:44:54PM +0100, Uladzislau Rezki (Sony) wrote:
> 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.
>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> ---
>  mm/vmalloc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 17e688cc7357..221d8950e13c 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -2252,7 +2252,9 @@ void vm_unmap_ram(const void *mem, unsigned int count)
>  	}
>
>  	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);
> --
> 2.30.2
>
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>


  reply	other threads:[~2022-12-21 19:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 17:44 [PATCH v2 1/3] mm: vmalloc: Avoid of calling __find_vmap_area() twise in __vunmap() Uladzislau Rezki (Sony)
2022-12-21 17:44 ` [PATCH v2 2/3] mm: vmalloc: Switch to find_unlink_vmap_area() in vm_unmap_ram() Uladzislau Rezki (Sony)
2022-12-22  8:50   ` Christoph Hellwig
2022-12-21 17:44 ` [PATCH v2 3/3] mm: vmalloc: Replace BUG_ON() by WARN_ON_ONCE() Uladzislau Rezki (Sony)
2022-12-21 19:13   ` Lorenzo Stoakes [this message]
2022-12-21 19:11 ` [PATCH v2 1/3] mm: vmalloc: Avoid of calling __find_vmap_area() twise in __vunmap() Lorenzo Stoakes
2022-12-22 14:22   ` Uladzislau Rezki
2022-12-22  8:56 ` Christoph Hellwig
2022-12-22 14:41   ` Uladzislau Rezki
2022-12-22 15:01     ` Christoph Hellwig
2022-12-22 17:02       ` Uladzislau Rezki
2022-12-22 11:38 ` Baoquan He
2022-12-22 14:43   ` Uladzislau Rezki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y6Nav+UHCPPdPO6Q@lucifer \
    --to=lstoakes@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=oleksiy.avramchenko@sony.com \
    --cc=urezki@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox