linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: John Hubbard <jhubbard@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>, Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH v1] mm/gup: remove (VM_)BUG_ONs
Date: Fri, 6 Jun 2025 19:06:55 +0100	[thread overview]
Message-ID: <72bb36f2-65b6-4785-af9d-5b1f8126fc78@lucifer.local> (raw)
In-Reply-To: <e898e52e-a223-4567-9514-b4a021b5d460@nvidia.com>

On Fri, Jun 06, 2025 at 10:57:44AM -0700, John Hubbard wrote:
> On 6/6/25 4:04 AM, Lorenzo Stoakes wrote:
> > On Fri, Jun 06, 2025 at 12:28:28PM +0200, David Hildenbrand wrote:
> >> On 06.06.25 12:19, Lorenzo Stoakes wrote:
> >>> On Fri, Jun 06, 2025 at 12:13:27PM +0200, Michal Hocko wrote:
> >>>> On Fri 06-06-25 11:01:18, David Hildenbrand wrote:
> >>>>> On 06.06.25 10:31, Michal Hocko wrote:
> >>>> [...]
> > So to me the only assessment needed is 'do we want to warn on this or not?'.
> >
> > And as you say, really WARN_ON_ONCE() seems appropriate, because nearly always
> > we will get flooded with useless information.
> >
>
> As yet another victim of such WARN_ON() floods at times, I've followed
> this thread with great interest. And after reflecting on it a bit, I believe
> that, surprisingly enough, WARN_ON() is a better replacement for VM_BUG_ON()
> than WARN_ON_ONCE(), because:

Right, these shouldn't be happening _at all_.

I'm easy on this point, I'd say in that case VM_WARN_ON() is the most
_conservative_ approach, since these are things that must not happen, and
so it's not unreasonable to fail to repress repetitions of the 'impossible'
:)

But I get the general point about ...WARN_ON_ONCE() avoiding floods.

David, what do you think?

>
> * The only time you'll be flooded with WARN_ON() messages is when *two*
> things happen at once:
>
>     a) Something that used to completely crash the machine (a VM_BUG_ON
>        condition) happens, and
>
>     b) You're in a loop and it keeps on happening. Yes, in -mm, that does
>        happen a lot (per-page loops, for example), but still.
>
> * It's *so* easy to miss a WARN_ON_ONCE(). We don't want that, not for a
> critical failure case that used to be a VM_BUG_ON().

However, I do dispute this point - warnings are pretty easy to pick up from
my point of view unless your dmesg is absolutely rammed, and if you're
concerned you can panic_on_warn right?

I treat any warning that I see for instance in a test run on qemu as a
'must fix' problem, let alone if observed on an actual hardware system.

Are you thinking of scenarios for instance where you have a lot of debug
output in dmesg and thus these fly by, and when you retry the operation it
won't show again and thus missed that way?

But of course this won't do much to help you should the operation be one
you happen to only perform once however! :)

>
>
> thanks,
> --
> John Hubbard
>

Cheers, Lorenzo


  reply	other threads:[~2025-06-06 18:07 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 14:05 [PATCH v1] mm/gup: remove (VM_)BUG_ONs David Hildenbrand
2025-06-04 14:22 ` Vlastimil Babka
2025-06-04 14:26   ` Suren Baghdasaryan
2025-06-04 14:48 ` Lorenzo Stoakes
2025-06-04 14:58   ` David Hildenbrand
2025-06-04 15:44     ` Lorenzo Stoakes
2025-06-04 15:42   ` Linus Torvalds
2025-06-04 16:05     ` Lorenzo Stoakes
2025-06-04 15:14 ` Jason Gunthorpe
2025-06-04 16:01   ` David Hildenbrand
2025-06-04 17:25 ` SeongJae Park
2025-06-04 19:12 ` Liam R. Howlett
2025-06-04 19:16   ` David Hildenbrand
2025-06-05  1:07 ` John Hubbard
2025-06-05  5:37   ` Vlastimil Babka
2025-06-05  6:08     ` David Hildenbrand
2025-06-05  8:48       ` Vlastimil Babka
2025-06-05 12:29         ` David Hildenbrand
2025-06-05  7:10 ` Michal Hocko
2025-06-06  8:10   ` David Hildenbrand
2025-06-06  8:31     ` Michal Hocko
2025-06-06  9:01       ` David Hildenbrand
2025-06-06 10:13         ` Michal Hocko
2025-06-06 10:19           ` Lorenzo Stoakes
2025-06-06 10:28             ` David Hildenbrand
2025-06-06 11:04               ` Lorenzo Stoakes
2025-06-06 11:44                 ` David Hildenbrand
2025-06-06 11:56                   ` Michal Hocko
2025-06-06 12:12                   ` Lorenzo Stoakes
2025-06-06 12:17                     ` David Hildenbrand
2025-06-06 17:57                 ` John Hubbard
2025-06-06 18:06                   ` Lorenzo Stoakes [this message]
2025-06-06 18:15                     ` David Hildenbrand
2025-06-06 18:21                       ` John Hubbard
2025-06-06 18:23                         ` David Hildenbrand
2025-06-06 18:31                           ` John Hubbard
2025-06-06 18:36                             ` David Hildenbrand
2025-06-06 18:39                               ` John Hubbard
2025-06-06 18:34                           ` Lorenzo Stoakes
2025-06-06 18:42                           ` Jason Gunthorpe
2025-06-06 18:46                             ` Lorenzo Stoakes
2025-06-06 19:03                               ` Lorenzo Stoakes
2025-06-07 13:42                                 ` Jason Gunthorpe
2025-06-07 13:53                                   ` Lorenzo Stoakes
2025-06-07 18:00                                     ` John Hubbard
2025-06-09  9:57                                       ` Vlastimil Babka
2025-07-24 10:54                                         ` Vlastimil Babka
2025-07-24 10:56                                           ` Lorenzo Stoakes
2025-07-24 17:27                                             ` John Hubbard
2025-06-11  9:32                                       ` David Hildenbrand
2025-06-11 12:03                                         ` Jason Gunthorpe
2025-06-11 12:06                                           ` Lorenzo Stoakes
2025-06-06 10:28             ` Michal Hocko
2025-06-06 10:27           ` David Hildenbrand
2025-06-06  8:12 ` David Hildenbrand

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=72bb36f2-65b6-4785-af9d-5b1f8126fc78@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).