lkml.org 
[lkml]   [2024]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v2 4/5] mm/memory-failure: move hwpoison_filter() higher up
    From
    Date
    On 2024/5/10 14:26, Jane Chu wrote:
    > Move hwpoison_filter() higher up as there is no need to spend a lot
    > cycles only to find out later that the page is supposed to be skipped
    > for hwpoison handling.
    >
    > Signed-off-by: Jane Chu <jane.chu@oracle.com>
    > ---
    > mm/memory-failure.c | 15 +++++++--------
    > 1 file changed, 7 insertions(+), 8 deletions(-)
    >
    > diff --git a/mm/memory-failure.c b/mm/memory-failure.c
    > index 62133c10fb51..2fa884d8b5a3 100644
    > --- a/mm/memory-failure.c
    > +++ b/mm/memory-failure.c
    > @@ -2236,6 +2236,13 @@ int memory_failure(unsigned long pfn, int flags)
    > goto unlock_mutex;
    > }
    >
    > + if (hwpoison_filter(p)) {
    > + if (flags & MF_COUNT_INCREASED)
    > + put_page(p);
    > + res = -EOPNOTSUPP;
    > + goto unlock_mutex;
    > + }

    It might not be a good idea to do hwpoison_filter() here. We don't hold extra page refcnt
    yet, so the page state will be really unstable. Or am I miss something?
    Thanks.
    .

    \
     
     \ /
      Last update: 2024-05-27 18:24    [W:5.659 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site