On Wed, May 13, 2026 at 01:48:11PM +0200, David Hildenbrand (Arm) wrote:
> > @@ -1441,10 +1456,10 @@ static int get_any_page(struct page *p, unsigned 
> > long flags)
> >                     goto try_again;
> >             }
> >             put_page(p);
> > -           ret = -EIO;
> > +           ret = -ENOTRECOVERABLE;
> >     }
> >  out:
> > -   if (ret == -EIO)
> > +   if (ret == -EIO || ret == -ENOTRECOVERABLE)
> >             pr_err("%#lx: unhandlable page.\n", page_to_pfn(p));
> >  
> >     return ret;
> > @@ -2431,6 +2448,9 @@ int memory_failure(unsigned long pfn, int flags)
> >                     res = action_result(pfn, MF_MSG_KERNEL_HIGH_ORDER, 
> > MF_IGNORED);
> >             }
> >             goto unlock_mutex;
> > +   } else if (res == -ENOTRECOVERABLE) {
> > +           res = action_result(pfn, MF_MSG_KERNEL, MF_IGNORED);
> > +           goto unlock_mutex;
> >     } else if (res < 0) {
> >             res = action_result(pfn, MF_MSG_GET_HWPOISON, MF_IGNORED);
> >             goto unlock_mutex;
> 
> That might probably read nicer as
> 
> switch (res) {
> case 0: ...
> case 1: ...
> case -ENOTRECOVERABLE:  ...
> case ...
> default:
> }
> 
> > 
> > 
> > If that is what you are suggestion, maybe we can create another
> > MF_MSG_RESERVED? and another return value for get_any_page() to track
> > the reserve pages ?
> 
> I guess "reserved" is really just like most other kernel pages. So I wouldn't
> special-case them here.
> 
> Or would there be a good reason?

Not really, treating them as MF_MSG_KERNEL is sufficient for my use
case.

Thank you for the review. I'm digesting all the feedback and will send
out a new revision shortly, where we can continue the discussion.

--breno

Reply via email to