linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hao <haokexin@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, "Rafael J. Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH] mm/khugepaged: Remove unnecessary try_to_freeze()
Date: Tue, 19 Dec 2023 08:44:42 +0800	[thread overview]
Message-ID: <ZYDm_sFglUZ23GG_@pek-khao-d3> (raw)
In-Reply-To: <20231218103451.fd11a2179a01d622cea01858@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]

On Mon, Dec 18, 2023 at 10:34:51AM -0800, Andrew Morton wrote:
> On Sat, 16 Dec 2023 19:43:41 +0800 Kevin Hao <haokexin@gmail.com> wrote:
> 
> > A freezable kernel thread can enter frozen state during freezing by
> > either calling try_to_freeze() or using wait_event_freezable() and its
> > variants. However, there is no need to use both methods simultaneously.
> > The freezable wait variants have been used in khugepaged_wait_work()
> > and khugepaged_alloc_sleep(), so remove this unnecessary
> > try_to_freeze().
> > 
> 
> Looks OK to me, but this will increase freezing latencies.  How
> significant is this?

I don't think this would cause observable freezing latencies, and most of time,
we won't enter the freezing state, it is worthwhile to reduce the overhead of
a function call.

On my Intel Alder Lake board (24 CPUs, 32G memory) with transparent hugepage enabled.

Before this patch:
  Freezing user space processes
  Freezing user space processes completed (elapsed 0.000 seconds)
  OOM killer disabled.
  Freezing remaining freezable tasks
  Freezing remaining freezable tasks completed (elapsed 0.001 seconds)

After this patch:
  Freezing user space processes
  Freezing user space processes completed (elapsed 0.000 seconds)
  OOM killer disabled.
  Freezing remaining freezable tasks
  Freezing remaining freezable tasks completed (elapsed 0.001 seconds)

> 
> Also, we already have a patch from you with this same title.  Please
> try to use different titles for different patches.

Sure, I will tweak it in v2.

Thanks,
Kevin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2023-12-19  0:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16 11:43 Kevin Hao
2023-12-18 18:34 ` Andrew Morton
2023-12-19  0:44   ` Kevin Hao [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=ZYDm_sFglUZ23GG_@pek-khao-d3 \
    --to=haokexin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@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