linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alex Shi <seakeel@gmail.com>
To: SeongJae Park <sj@kernel.org>
Cc: Alex Shi <alexs@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm/damon: remove damon_lock
Date: Wed, 10 Nov 2021 23:35:11 +0800	[thread overview]
Message-ID: <CAJy-AmndDjZNLXr_9fNwQSKSZhahTKMKhRTTskiZ-yVnpqUzsQ@mail.gmail.com> (raw)
In-Reply-To: <20211110143535.15809-1-sj@kernel.org>

On Wed, Nov 10, 2021 at 10:35 PM SeongJae Park <sj@kernel.org> wrote:

> Yes, it would effectively avoid the problem case.  However, I'm unsure how much
> performance gain this change is providing, as apparently the lock is not being
> used in performance critical parts.
>
> I'm also unsure if this change is reducing the complexity of the code or not.
> For an example, this change allows someone to show non-zero nr_running_ctxs
> while no real kdamond is running, before __damon_start() is called, or when it
> failed.  I think this would never be a real issue, but might make my poor brain
> a little bit confused when debugging.
>
> Also, we might add some more variables and code section that should be mutually
> exclusive to concurrent DAMON users in future.
>
> atomic_t is obviously enough for protecting a variable.  But, IMHO, it might
> not necessarily be the best choice for non-performance-critical mutex sections.
>
> Please feel free to let me know if I'm missing something.
>

hi SJ,

Thanks for the quick reply!
Yes, it's fine to use mutex on a slow path, it won't cost much. but I
just feel itchy
while looking at the code, especially since it only guards an int...
Anyway, it's up to you.

Thanks
Alex


      reply	other threads:[~2021-11-10 15:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 11:47 alexs
2021-11-10 12:40 ` SeongJae Park
2021-11-10 13:41   ` Alex Shi
2021-11-10 14:04     ` Alex Shi
2021-11-10 14:35       ` SeongJae Park
2021-11-10 15:35         ` Alex Shi [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=CAJy-AmndDjZNLXr_9fNwQSKSZhahTKMKhRTTskiZ-yVnpqUzsQ@mail.gmail.com \
    --to=seakeel@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexs@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sj@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