From: Leonardo Bras <leonardo@linux.ibm.com>
To: jhubbard@nvidia.com, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org,
linux-arch@vger.kernel.org, linux-mm@kvack.org
Cc: keith.busch@intel.com, tglx@linutronix.de, arnd@arndb.de,
gregkh@linuxfoundation.org, yuehaibing@huawei.com,
npiggin@gmail.com, rppt@linux.ibm.com, mahesh@linux.vnet.ibm.com,
jgg@ziepe.ca, paulus@samba.org, aneesh.kumar@linux.ibm.com,
ganeshgr@linux.ibm.com, akpm@linux-foundation.org,
ira.weiny@intel.com, dan.j.williams@intel.com,
allison@lohutok.net
Subject: Re: [PATCH v3 00/11] Introduces new count-based method for monitoring lockless pagetable walks
Date: Fri, 27 Sep 2019 11:46:04 -0300 [thread overview]
Message-ID: <8fe1ee1abf52719e75902dc7d5cd1e91751eaba7.camel@linux.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]
John Hubbard <jhubbard@nvidia.com> writes:
> Hi Leonardo,
>
> Thanks for adding linux-mm to CC for this next round of reviews. For the benefit
> of any new reviewers, I'd like to add that there are some issues that were discovered
> while reviewing the v2 patchset, that are not (yet) addressed in this v3 series.
> Since those issues are not listed in the cover letter above, I'll list them here
Thanks for bringing that.
The cover letter is a great place to put this info, I will keep that in
mind for future patchsets.
>
> 1. The locking model requires a combination of disabling interrupts and
> atomic counting and memory barriers, but
>
> a) some memory barriers are missing
> (start/end_lockless_pgtbl_walk), and
It seems that it works fine today because of the amount of intructions
executed between the irq_disable / start_lockless_pgtbl_walk and where
the THP collapse/split can happen. (It's very unlikely that it reorders
that much).
But I don't think it would be so bad to put a memory barrier after
irq_disable just in case.
> b) some cases (patch #8) fail to disable interrupts
I have done some looking into that, and it seems that some uses of
{start,end}_lockless_pgtbl_walk are unneeded, because they operate in
(nested) guest pgd and I was told it's safe against THP split/collapse.
In other uses, there is no interrupt disable because the function is
called in real mode, with MSR_EE=0, and there we have instructions
disabled, so there is no need to disable them again.
>
> ...so the synchronization appears to be inadequate. (And if it *is* adequate, then
> definitely we need the next item, to explain it.)
>
> 2. Documentation of the synchronization/locking model needs to exist, once we
> figure out the exact details of (1).
I will add the missing doc in the code, so it may be easier to
understand in the future.
>
> 3. Related to (1), I've asked to change things so that interrupt controls and
> atomic inc/dec are in the same start/end calls--assuming, of course, that the
> caller can tolerate that.
I am not sure if it would be ok to use irq_{save,restore} in real mode,
I will do some more reading of the docs before addressing this.
>
> 4. Please see the v2 series for any other details I've missed.
>
> thanks,
> --
> John Hubbard
> NVIDIA
>
Thank you for helping, John!
Best regards,
Leonardo Bras
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2019-09-27 14:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 14:46 Leonardo Bras [this message]
2019-09-27 23:25 ` [PATCH v3 00/11] Introduces new count-based method for monitoring lockless pagetable walks Leonardo Bras
-- strict thread matches above, loose matches on Subject: below --
2019-09-24 21:24 Leonardo Bras
2019-09-24 22:58 ` John Hubbard
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=8fe1ee1abf52719e75902dc7d5cd1e91751eaba7.camel@linux.ibm.com \
--to=leonardo@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=allison@lohutok.net \
--cc=aneesh.kumar@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=ganeshgr@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=keith.busch@intel.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.vnet.ibm.com \
--cc=npiggin@gmail.com \
--cc=paulus@samba.org \
--cc=rppt@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).