From: Steve MacLean <Steve.MacLean@microsoft.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Changbin Du <changbin.du@intel.com>,
Eric Saint-Etienne <eric.saint.etienne@oracle.com>,
John Keeping <john@metanate.com>, Andi Kleen <ak@linux.intel.com>,
Song Liu <songliubraving@fb.com>,
Davidlohr Bueso <dave@stgolabs.net>, Leo Yan <leo.yan@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Brian Robbins <brianrob@microsoft.com>,
Tom McDonald <Thomas.McDonald@microsoft.com>,
John Salem <josalem@microsoft.com>
Subject: RE: [PATCH] perf map: fix overlapped map handling
Date: Fri, 20 Sep 2019 21:46:15 +0000 [thread overview]
Message-ID: <BN8PR21MB1362B1921DF8ABF3A19B43A5F7880@BN8PR21MB1362.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20190920193852.GI4865@kernel.org>
>> after->start = map->end;
>> + after->pgoff = pos->map_ip(pos, map->end);
>
> So is this equivalent to what __split_vma() does in the kernel, i.e.:
>
> if (new_below)
> new->vm_end = addr;
> else {
> new->vm_start = addr;
> new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT);
> }
>
> where new->vm_pgoff starts equal to the vm_pgoff of the mmap being split?
It is roughly equivalent. The pgoff in struct map is stored in bytes not in pages, so it doesn't include the shift.
An earlier version of this patch used:
after->start = map->end;
+ after->pgoff += map->end - pos->start;
Instead of the newer Functionally equivalent:
after->start = map->end;
+ after->pgoff = pos->map_ip(pos, map->end);
I preferred the latter form as it made more sense with the assertion that the mapping of map->end should match in pos and after.
Steve
next prev parent reply other threads:[~2019-09-20 21:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 19:20 [PATCH] perf map: fix overlapped map handling Steve MacLean
2019-09-20 19:38 ` Arnaldo Carvalho de Melo
2019-09-20 21:46 ` Steve MacLean [this message]
2019-09-27 15:35 ` Arnaldo Carvalho de Melo
2019-09-28 1:32 ` Steve MacLean
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=BN8PR21MB1362B1921DF8ABF3A19B43A5F7880@BN8PR21MB1362.namprd21.prod.outlook.com \
--to=steve.maclean@microsoft.com \
--cc=Thomas.McDonald@microsoft.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=arnaldo.melo@gmail.com \
--cc=brianrob@microsoft.com \
--cc=changbin.du@intel.com \
--cc=dave@stgolabs.net \
--cc=eric.saint.etienne@oracle.com \
--cc=john@metanate.com \
--cc=jolsa@redhat.com \
--cc=josalem@microsoft.com \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=songliubraving@fb.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).