On Mon 06-04-20 09:40:05, David Hildenbrand wrote: > 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. This definitely should be done on per-case basis. Many of those bug ons are historical and they wouldn't be allowed these days. So I would definitely recommend going through each of them and re-evaluate whether they are really needed and whether they serve any purpose. A rule of thumb is that if we can handle the situation more gracefully then the BUG_ON should be simply dropped. If a verbatim output in a debugging mode would serve a good purpose then WARN{_ONECE} would serve a good purpose and if a crash is would help debugging in a DEBUG_VM mode then use the VM_BUG_ON instead. -- Michal Hocko SUSE Labs