From: Wei Yang <richardw.yang@linux.intel.com>
To: David Rientjes <rientjes@google.com>
Cc: Wei Yang <richardw.yang@linux.intel.com>,
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: Tue, 7 Jan 2020 10:33:57 +0800 [thread overview]
Message-ID: <20200107023357.GD15341@richard> (raw)
In-Reply-To: <alpine.DEB.2.21.2001061803200.55132@chino.kir.corp.google.com>
On Mon, Jan 06, 2020 at 06:07:29PM -0800, David Rientjes wrote:
>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.
Ah, thanks David. You are so supportive.
--
Wei Yang
Help you, Help me
prev parent reply other threads:[~2020-01-07 2:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-03 14:34 Wei Yang
2020-01-03 19:29 ` David Rientjes
2020-01-03 23:39 ` Wei Yang
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 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-07 1:26 ` Wei Yang
2020-01-07 2:07 ` David Rientjes
2020-01-07 2:33 ` Wei Yang [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=20200107023357.GD15341@richard \
--to=richardw.yang@linux.intel.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=rientjes@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox