From: Marco Elver <elver@google.com>
To: Jackie Liu <liu.yun@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>
Cc: glider@google.com, dvyukov@google.com,
kasan-dev@googlegroups.com, linux-mm@kvack.org
Subject: Re: [PATCH v4] mm/kfence: print disabling or re-enabling message
Date: Wed, 18 May 2022 11:12:07 +0200 [thread overview]
Message-ID: <YoS4Z+zJoKkiHUY6@elver.google.com> (raw)
In-Reply-To: <20220518073105.3160335-1-liu.yun@linux.dev>
On Wed, May 18, 2022 at 03:31PM +0800, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> By printing information, we can friendly prompt the status change
> information of kfence by dmesg and record by syslog.
>
> Also, set kfence_enabled to false only when needed.
>
> Co-developed-by: Marco Elver <elver@google.com>
Signed-off-by: Marco Elver <elver@google.com>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Reviewed-by: Marco Elver <elver@google.com>
> ---
> v1->v2:
> fixup by Marco Elver <elver@google.com>
> v2->v3:
> write kfence_enabled=false only true before
> v3->v4:
> cleanup
>
> mm/kfence/core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/mm/kfence/core.c b/mm/kfence/core.c
> index 11a954763be9..af0489d4d149 100644
> --- a/mm/kfence/core.c
> +++ b/mm/kfence/core.c
> @@ -67,8 +67,11 @@ static int param_set_sample_interval(const char *val, const struct kernel_param
> if (ret < 0)
> return ret;
>
> - if (!num) /* Using 0 to indicate KFENCE is disabled. */
> + /* Using 0 to indicate KFENCE is disabled. */
> + if (!num && READ_ONCE(kfence_enabled)) {
> + pr_info("disabled\n");
> WRITE_ONCE(kfence_enabled, false);
> + }
>
> *((unsigned long *)kp->arg) = num;
>
> @@ -874,6 +877,7 @@ static int kfence_enable_late(void)
>
> WRITE_ONCE(kfence_enabled, true);
> queue_delayed_work(system_unbound_wq, &kfence_timer, 0);
> + pr_info("re-enabled\n");
> return 0;
> }
>
> --
> 2.25.1
>
prev parent reply other threads:[~2022-05-18 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 7:31 Jackie Liu
2022-05-18 9:12 ` Marco Elver [this message]
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=YoS4Z+zJoKkiHUY6@elver.google.com \
--to=elver@google.com \
--cc=akpm@linux-foundation.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-mm@kvack.org \
--cc=liu.yun@linux.dev \
/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