From: Jiaqi Yan <jiaqiyan@google.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: nao.horiguchi@gmail.com, linmiaohe@huawei.com,
jane.chu@oracle.com, ioworker0@gmail.com, muchun.song@linux.dev,
akpm@linux-foundation.org, shuah@kernel.org, corbet@lwn.net,
rientjes@google.com, duenwen@google.com, fvdl@google.com,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v3 1/3] mm/memory-failure: userspace controls soft-offlining pages
Date: Tue, 18 Jun 2024 22:25:43 -0700 [thread overview]
Message-ID: <CACw3F53SQHQaaBAyEMww=iPXENhG3uVbEzedG+0S+gvz+O3kPQ@mail.gmail.com> (raw)
In-Reply-To: <ZnJmsqvJz63imq3O@localhost.localdomain>
On Tue, Jun 18, 2024 at 10:03 PM Oscar Salvador <osalvador@suse.de> wrote:
>
> On Mon, Jun 17, 2024 at 05:05:43PM +0000, Jiaqi Yan wrote:
> > - * Returns 0 on success
> > - * -EOPNOTSUPP for hwpoison_filter() filtered the error event
> > + * Returns 0 on success,
> > + * -EOPNOTSUPP for hwpoison_filter() filtered the error event,
> > + * -EOPNOTSUPP if disabled by /proc/sys/vm/enable_soft_offline,
> > * < 0 otherwise negated errno.
> > *
> > * Soft offline a page, by migration or invalidation,
> > @@ -2783,6 +2795,12 @@ int soft_offline_page(unsigned long pfn, int flags)
> > return -EIO;
> > }
> >
> > + if (!sysctl_enable_soft_offline) {
> > + pr_info("%#lx: OS-wide disabled\n", pfn);
> > + put_ref_page(pfn, flags);
> > + return -EOPNOTSUPP;
> > + }
>
> We should not be doing anything if soft_offline is disabled, so this check should
> be placed upfront, at the very beginning of the function.
> Then you can remove the 'put_ref_page' call.
I think if MF_COUNT_INCREASED is in flags, we still need to
put_ref_page(), right?
>
>
> --
> Oscar Salvador
> SUSE Labs
next prev parent reply other threads:[~2024-06-19 5:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 17:05 [PATCH v3 0/3] Userspace controls soft-offline pages Jiaqi Yan
2024-06-17 17:05 ` [PATCH v3 1/3] mm/memory-failure: userspace controls soft-offlining pages Jiaqi Yan
2024-06-17 19:13 ` Andrew Morton
2024-06-17 23:17 ` Jiaqi Yan
2024-06-18 3:01 ` Miaohe Lin
2024-06-19 6:35 ` Jiaqi Yan
2024-06-19 5:03 ` Oscar Salvador
2024-06-19 5:13 ` Oscar Salvador
2024-06-19 5:26 ` Jiaqi Yan
2024-06-19 5:23 ` Oscar Salvador
2024-06-19 5:25 ` Jiaqi Yan [this message]
2024-06-17 17:05 ` [PATCH v3 2/3] selftest/mm: test enable_soft_offline behaviors Jiaqi Yan
2024-06-17 17:05 ` [PATCH v3 3/3] docs: mm: add enable_soft_offline sysctl Jiaqi Yan
2024-06-19 5:19 ` Oscar Salvador
2024-06-20 17:25 ` Jiaqi Yan
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='CACw3F53SQHQaaBAyEMww=iPXENhG3uVbEzedG+0S+gvz+O3kPQ@mail.gmail.com' \
--to=jiaqiyan@google.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=duenwen@google.com \
--cc=fvdl@google.com \
--cc=ioworker0@gmail.com \
--cc=jane.chu@oracle.com \
--cc=linmiaohe@huawei.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=nao.horiguchi@gmail.com \
--cc=osalvador@suse.de \
--cc=rientjes@google.com \
--cc=shuah@kernel.org \
/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