From: Andrea Righi <andrea@betterlinux.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Hillf Danton <dhillf@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan.kim@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Johannes Weiner <jweiner@redhat.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] [PATCH v5 0/3] fadvise: support POSIX_FADV_NOREUSE
Date: Mon, 13 Feb 2012 02:13:19 +0100 [thread overview]
Message-ID: <20120213011319.GB2052@thinkpad> (raw)
In-Reply-To: <87sjigx7ho.fsf@linux.vnet.ibm.com>
On Sun, Feb 12, 2012 at 11:24:27PM +0530, Aneesh Kumar K.V wrote:
> On Sun, 12 Feb 2012 12:58:34 +0100, Andrea Righi <andrea@betterlinux.com> wrote:
> > On Sun, Feb 12, 2012 at 03:16:07PM +0800, Hillf Danton wrote:
> > > Hello Andrea
> > >
> > > On Sun, Feb 12, 2012 at 8:21 AM, Andrea Righi <andrea@betterlinux.com> wrote:
> > > [...]
> > > > - Some of the routines to implement the generic interval tree has been taken
> > > > from the x86 PAT code, that uses interval trees to keep track of PAT ranges
> > > > (in the future it would be interesting to convert also the x86 PAT code to
> > > > use the generic interval tree implementation).
> > > >
> > > Perhaps the tree implemented in this work could also be used in tracking
> > > regions in mm/hugetlb.c.
> > >
> > > Thanks
> > > Hillf
> >
> > Thanks, Hillf.
> >
> > Yes, I quickly looked at the hugtlb code, it seems another potential
> > user of the interval tree. Now all the hugetlb regions are stored in a
> > list, the interval tree is a more efficient structure for lookups -
> > O(log(n)), so there are probably advantages in presence of many
> > different disjoint intervals.
> >
> > mmh... at the moment there's not a way to map region_count() with the
> > current kinterval API, but we can easily extend it to provide also this
> > feature (count the overlap size of two intervals).
> >
>
> I am also extending the hugetlb region list in the hugetlb cgroup
> patchset i recently posted to make sure we don't merge region if the
> associated private data doesn't match (in my case it is the pointer to
> hugetlb cgroup). Ref:
> http://article.gmane.org/gmane.linux.kernel.mm/73829
>
> The goal is to make sure a region add with different private value
> results in below.
>
>
> old
> | hcg1 |
> -------------------
>
> new
> | hcg2 |
> ----------------------------------
>
> results in
>
> | hcg2 | | hcg1 | | hcg2 |
> --------- __________________ ----------
>
>
> -aneesh
Yep! This is different from my case, at least according to the current
implementation. Using kintervals the new range hcg2 will completely
overwrite hcg1, because the default behavior is that new ranges
overwrite old ranges.
To get the same result the new range (hcg2) should be defined inside
the old range (hcg1):
new
| hcg2 |
-------------------
old
| hcg1 |
----------------------------------
In this case result will be:
| hcg1 | | hcg2 | | hcg1 |
--------- __________________ ----------
mmmh.. I'm wondering if there's a better way to make the intervals even
more generic, so that it would be possible to specify also a different
behavior in case of conflicts... (i.e., new wins vs old wins).
Thanks,
-Andrea
next prev parent reply other threads:[~2012-02-13 1:14 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-12 0:21 [RFC] [PATCH v5 0/3] fadvise: support POSIX_FADV_NOREUSE Andrea Righi
2012-02-12 0:21 ` [PATCH v5 1/3] kinterval: routines to manipulate generic intervals Andrea Righi
2012-02-13 0:48 ` Andrea Righi
2012-02-12 0:21 ` [PATCH v5 2/3] mm: filemap: introduce mark_page_usedonce Andrea Righi
2012-02-12 0:21 ` [PATCH v5 3/3] fadvise: implement POSIX_FADV_NOREUSE Andrea Righi
2012-02-13 16:22 ` KOSAKI Motohiro
2012-02-13 18:00 ` Andrea Righi
2012-02-15 23:35 ` Arun Sharma
2012-02-15 23:47 ` Andrea Righi
2012-02-15 23:57 ` Arun Sharma
2012-02-16 0:56 ` Andrea Righi
2012-02-16 2:10 ` Arun Sharma
2012-02-16 10:39 ` Andrea Righi
2012-02-16 18:43 ` Arun Sharma
2012-02-16 18:57 ` Andrea Righi
2012-02-16 19:07 ` Arun Sharma
2012-02-27 2:33 ` KAMEZAWA Hiroyuki
2012-02-27 10:46 ` Andrea Righi
2012-02-12 7:16 ` [RFC] [PATCH v5 0/3] fadvise: support POSIX_FADV_NOREUSE Hillf Danton
2012-02-12 11:58 ` Andrea Righi
2012-02-12 17:54 ` Aneesh Kumar K.V
2012-02-13 1:13 ` Andrea Righi [this message]
2012-02-14 21:33 ` Andrew Morton
2012-02-14 22:06 ` John Stultz
2012-02-14 22:59 ` Andrea Righi
2012-02-14 23:22 ` Andrew Morton
2012-02-15 1:35 ` Andrea Righi
2012-02-15 23:48 ` KAMEZAWA Hiroyuki
2012-02-16 0:43 ` Andrea Righi
2014-01-02 21:25 ` Phillip Susi
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=20120213011319.GB2052@thinkpad \
--to=andrea@betterlinux.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=dhillf@gmail.com \
--cc=hughd@google.com \
--cc=jweiner@redhat.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan.kim@gmail.com \
--cc=riel@redhat.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