Re: [PATCH] mm: use VM_BUG_ON*() helpers to dump more debugging info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06.04.20 05:55, qiwuchen55@xxxxxxxxx wrote:
> From: chenqiwu <chenqiwu@xxxxxxxxxx>
> 
> This patch use VM_BUG_ON*() helpers instead of simple BUG_ON()
> in some of the main mm codes. If CONFIG_DEBUG_VM is set, we can
> get more debugging information when the bug is hit.
> 

The "issue" in this context of VM_BUG_ON*() is that, without
CONFIG_DEBUG_VM,  there won't really be any runtime checks anymore,
meaning a production system would not stop and BUG_ON() (which would be
disruptive, but there is a chance to debug this), instead it would
happily continue to run, eventually messing up something else.

This is a clear change introduced in this series.

My gut feeling is that we want to convert this on a per-case basis instead.

> Signed-off-by: chenqiwu <chenqiwu@xxxxxxxxxx>
> ---
>  mm/memory.c   | 25 +++++++++++++------------
>  mm/mmap.c     |  8 ++++----
>  mm/rmap.c     | 10 +++++-----
>  mm/swapfile.c | 16 ++++++++--------
>  mm/vmscan.c   |  6 +++---
>  5 files changed, 33 insertions(+), 32 deletions(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index 586271f..082472f 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -912,7 +912,7 @@ static inline int copy_pud_range(struct mm_struct *dst_mm, struct mm_struct *src
>  		if (pud_trans_huge(*src_pud) || pud_devmap(*src_pud)) {
>  			int err;
>  
> -			VM_BUG_ON_VMA(next-addr != HPAGE_PUD_SIZE, vma);
> +			VM_BUG_ON_VMA(next - addr != HPAGE_PUD_SIZE, vma);

unrelated change.


-- 
Thanks,

David / dhildenb






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux