public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Nyunwoo Kim <knw0507@naver.com>
Cc: David Rientjes <rientjes@google.com>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/oom_kill: Insert newline for better readability
Date: Thu, 30 Apr 2026 15:04:41 +0200	[thread overview]
Message-ID: <afNTafWH7UUc3zl6@tiehlicka> (raw)
In-Reply-To: <20260430125321.5679-1-knw0507@naver.com>

On Thu 30-04-26 21:53:21, Nyunwoo Kim wrote:
> Insert a newline in check_panic_on_oom() for better readability.
> 
> Signed-off-by: Nyunwoo Kim <knw0507@naver.com>
> ---
> This is my first patch and I am using it as practice to learn kernel
> development. If this has wasted your time, I apologize; it was unintentional.
> Thank you for your consideration.

Patches like this are not adding any real value. While aiming for a
better readable code is a nobel goal I would recommend adding clean ups
like this one to other changes/patches that are improving the code
(either fixing existing bugs or making the overall code much better).

Thanks for trying and keep looking for something that might improve the
code.

> 
>  mm/oom_kill.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index 5c6c95c169ee..86a08deaa697 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -1076,6 +1076,7 @@ static void check_panic_on_oom(struct oom_control *oc)
>  {
>  	if (likely(!sysctl_panic_on_oom))
>  		return;
> +
>  	if (sysctl_panic_on_oom != 2) {
>  		/*
>  		 * panic_on_oom == 1 only affects CONSTRAINT_NONE, the kernel
> @@ -1085,9 +1086,11 @@ static void check_panic_on_oom(struct oom_control *oc)
>  		if (oc->constraint != CONSTRAINT_NONE)
>  			return;
>  	}
> +
>  	/* Do not panic for oom kills triggered by sysrq */
>  	if (is_sysrq_oom(oc))
>  		return;
> +
>  	dump_header(oc);
>  	panic("Out of memory: %s panic_on_oom is enabled\n",
>  		sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide");
> -- 
> 2.25.1

-- 
Michal Hocko
SUSE Labs

      reply	other threads:[~2026-04-30 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 12:53 [PATCH] mm/oom_kill: Insert newline for better readability Nyunwoo Kim
2026-04-30 13:04 ` Michal Hocko [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=afNTafWH7UUc3zl6@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=knw0507@naver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=shakeel.butt@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