linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	x86@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 1/3] x86,mm/pat: Use generic interval trees
Date: Thu, 22 Aug 2019 13:10:37 -0700	[thread overview]
Message-ID: <CANN689E+xsZWOKFBuv1pkpXO-i4i=Yhg3ebnD++ujz7yfDqwuQ@mail.gmail.com> (raw)
In-Reply-To: <20190822181701.zhfdkjbwjh56i3ax@linux-r8p5>

I think vma_interval_tree is a bit of a mixed bag, but mostly leans
towards using half closed intervals.

Right now vma_last_pgoff() has to do -1 because of the interval tree
using closed intervals. Similarly, rmap_walk_file(), which I consider
to be the main user of the vma_interval_tree, also has to do -1 when
computing pgoff_end because of the interval tree closed intervals. So,
I think overall vma_interval_tree would also more naturally use
half-open intervals.

But, that's not a 100% thing for vma_interval_tree, as it also has
uses that do stabbing queries (in arch specific code, in hugetlb
cases, and in dax code).

On Thu, Aug 22, 2019 at 11:17 AM Davidlohr Bueso <dave@stgolabs.net> wrote:
>
> >On Wed, 21 Aug 2019, Michel Lespinasse wrote:
> >>As I had commented some time ago, I wish the interval trees used [start,end)
> >>intervals instead of [start,last] - it would be a better fit for basically
> >>all of the current interval tree users.
>
> So the vma_interval_tree (which is a pretty important user) tends to break this
> pattern, as most lookups are [a,a]. We would have to update most of the
> vma_interval_tree_foreach calls, for example, to now do [a,a+1[ such that we
> don't break things. Some cases for the anon_vma_tree as well (ie memory-failure).
>
> I'm not sure anymore it's worth going down this path as we end up exchanging one
> hack for another (and the vma_interval_tree is a pretty big user); but I'm sure
> you're aware of this and thus disagree.
>
> Thanks,
> Davidlohr



-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

  reply	other threads:[~2019-08-22 20:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 22:46 [PATCH -tip 0/3] x86,mm/pat: Move towards using generic interval trees Davidlohr Bueso
2019-08-13 22:46 ` [PATCH 1/3] x86,mm/pat: Use " Davidlohr Bueso
2019-08-21 16:03   ` Peter Zijlstra
2019-08-21 21:57   ` Michel Lespinasse
2019-08-22  4:49     ` Davidlohr Bueso
2019-08-22 18:17       ` Davidlohr Bueso
2019-08-22 20:10         ` Michel Lespinasse [this message]
2019-09-05  0:52           ` Davidlohr Bueso
2019-09-05  2:00             ` Michel Lespinasse
2019-09-05  3:45               ` Davidlohr Bueso
2019-09-05  5:03               ` Davidlohr Bueso
2019-08-22 20:24       ` Michel Lespinasse
2019-08-13 22:46 ` [PATCH 2/3] x86,mm/pat: Cleanup some of the local memtype_rb_* calls Davidlohr Bueso
2019-08-13 22:46 ` [PATCH 3/3] x86,mm/pat: Rename pat_rbtree.c to pat_interval.c Davidlohr Bueso

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='CANN689E+xsZWOKFBuv1pkpXO-i4i=Yhg3ebnD++ujz7yfDqwuQ@mail.gmail.com' \
    --to=walken@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).