[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+CK2bANEkfEe_qMTivTyAhFd8+bi_YmQknJOtep2Q51xpdkLg@mail.gmail.com>
Date: Sat, 22 Jul 2023 23:35:12 -0400
From: Pasha Tatashin <pasha.tatashin@...een.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: akpm@...ux-foundation.org, corbet@....net, linux-mm@...ck.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
rick.p.edgecombe@...el.com
Subject: Re: [PATCH v2 1/3] mm/page_table_check: Do WARN_ON instead of BUG_ON
On Sat, Jul 22, 2023 at 9:56 PM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Sat, Jul 22, 2023 at 11:15:06PM +0000, Pasha Tatashin wrote:
> > static struct page_table_check *get_page_table_check(struct page_ext *page_ext)
> > {
> > - BUG_ON(!page_ext);
> > + PAGE_TABLE_CHECK_WARN(!page_ext);
> > +
> > return (void *)(page_ext) + page_table_check_ops.offset;
> > }
>
> [...]
>
> > @@ -137,15 +144,15 @@ void __page_table_check_zero(struct page *page, unsigned int order)
> > struct page_ext *page_ext;
> > unsigned long i;
> >
> > - BUG_ON(PageSlab(page));
> > + PAGE_TABLE_CHECK_WARN(PageSlab(page));
> >
> > page_ext = page_ext_get(page);
> > - BUG_ON(!page_ext);
> > + PAGE_TABLE_CHECK_WARN(!page_ext);
> > for (i = 0; i < (1ul << order); i++) {
> > struct page_table_check *ptc = get_page_table_check(page_ext);
>
> Seems like we're going to warn about !page_ext twice? Or more than
> twice -- once per tail page?
>
> But then we'll crash because page_ext was NULL and offset was small?
Good catch, page_ext should not be NULL, yet I do not want to add
BUG_ON, let me fix this by warning and gracefully returning if
page_ext is NULL
Pasha
Powered by blists - more mailing lists