All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	vdavydov.dev@gmail.com, Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	cgroups@vger.kernel.org, linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Yang Shi <yang.shi@linux.alibaba.com>
Subject: Re: [RFC PATCH] mm: thp: grab the lock before manipulation defer list
Date: Mon, 6 Jan 2020 18:07:29 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.21.2001061803200.55132@chino.kir.corp.google.com> (raw)
In-Reply-To: <20200107012624.GB15341@richard>

On Tue, 7 Jan 2020, Wei Yang wrote:

> >One thing you might want to do is pull the "if (compound)" check out
> >and place it outside of the spinlock check. It would then simplify
> >this signficantly so it is something like
> >if (compound) {
> >  spin_lock();
> >  list = page_deferred_list(page);
> >  if (!list_empty(list)) {
> >    list_del_init(list);
> >    from->..split_queue_len--;
> >  }
> >  spin_unlock();
> >}
> >
> >Same for the block below. I would pull the check for compound outside
> >of the spinlock call since it is a value that shouldn't change and
> >would eliminate an unnecessary lock in the non-compound case.
> 
> This is reasonable, if no objection from others, I would change this in v2.

Looks fine to me; I don't see it as a necessary improvement but there's 
also no reason to object to it.  It's definitely a patch that is needed, 
however, for the simple reason that with the existing code we can 
manipulate the deferred split queue incorrectly so either way works for 
me.  Feel free to keep my acked-by.

  reply	other threads:[~2020-01-07  2:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03 14:34 [RFC PATCH] mm: thp: grab the lock before manipulation defer list Wei Yang
2020-01-03 19:29 ` David Rientjes
2020-01-03 19:29   ` David Rientjes
2020-01-03 23:39   ` Wei Yang
2020-01-04  0:44     ` David Rientjes
2020-01-04  0:44       ` David Rientjes
2020-01-06  1:20       ` Wei Yang
2020-01-06 10:23 ` Michal Hocko
2020-01-07  1:22   ` Wei Yang
2020-01-07  8:38     ` Michal Hocko
2020-01-08  0:35       ` Wei Yang
2020-01-08  9:40         ` Michal Hocko
2020-01-09  2:03           ` Wei Yang
2020-01-09  8:34             ` Michal Hocko
2020-01-09  2:03           ` Wei Yang
2020-01-09  3:18           ` Wei Yang
2020-01-09  8:36             ` Michal Hocko
2020-01-09  8:52               ` Wei Yang
2020-01-06 16:18 ` Alexander Duyck
2020-01-06 16:18   ` Alexander Duyck
2020-01-07  1:26   ` Wei Yang
2020-01-07  2:07     ` David Rientjes [this message]
2020-01-07  2:07       ` David Rientjes
2020-01-07  2:33       ` Wei Yang

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=alpine.DEB.2.21.2001061803200.55132@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.duyck@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=richardw.yang@linux.intel.com \
    --cc=vdavydov.dev@gmail.com \
    --cc=yang.shi@linux.alibaba.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.