Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jan.glauber@gmail.com (Jan Glauber)
Subject: [lttng-dev] [PATCH lttng-modules] Fix: Building the event list fails on fragmented memory
Date: Thu, 25 Jun 2015 15:50:58 +0200	[thread overview]
Message-ID: <20150625135056.GB25618@hal> (raw)
In-Reply-To: <165181671.2917.1435239449159.JavaMail.zimbra@efficios.com>

On Thu, Jun 25, 2015 at 01:37:29PM +0000, Mathieu Desnoyers wrote:
> ----- On Jun 25, 2015, at 9:00 AM, Mathieu Desnoyers mathieu.desnoyers at efficios.com wrote:
> 
> > ----- On Jun 25, 2015, at 4:08 AM, Jan Glauber jan.glauber at gmail.com wrote:
> > 
> >> On Tue, Jun 23, 2015 at 09:04:18PM +0000, Mathieu Desnoyers wrote:
> >>> Nope, it wasn't it. metadata_written is always <= cache_alloc, so the
> >>> current upstream code looks correct.
> >>> 
> >>> I've just tried after changing the CPU configuration from "hypervisor
> >>> default" to "copy host cpu config" on my machine, and was then unable
> >>> to reproduce. I wonder if there is not an issue with __memcpy implementation
> >>> for specific x86_64 processors (e.g. reading too many bytes from the vmalloc'd
> >>> area).
> >>> 
> >>> Thoughts ?
> >> 
> >> Just speculation without further debugging data from the hypervisor setup
> >> where it fails...
> >> 
> >> From my understanding memcpy should work regardless of kmalloc or
> >> vmalloc.
> >> 
> >> Maybe the length parameter of the memcpy is wrong?
> >> With kmalloc and the 1:1 mapping this wont matter but if the memcpy
> >> crosses a page it might fault if the next page is not vmalloc'ed.
> >> 
> >> But the fault address ffffc900038d995e looks more like src is completely
> >> messed up.
> >> 
> >> What is the difference between the CPU configurations you tried?
> > 
> > Actually, I just narrowed it down to a missing mutex around the metadata
> > cache accesses. The updater can reallocate the memory, and the reader
> > (which outputs from the cache to a ring buffer) assumes that it does not
> > have to lock the metadata cache because it only reads its content.
> > Unfortunately, this does not take into account that the memory backing
> > the cache can be reallocated.
> > 
> > I'll prepare a fix.

Nice catch!

--Jan



      reply	other threads:[~2015-06-25 13:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  9:19 Martin Leisener
2015-06-10  7:14 ` Mathieu Desnoyers
2015-06-10 13:17   ` Martin Leisener
2015-06-13 19:32     ` Mathieu Desnoyers
2015-06-15 18:27       ` Martin Leisener
2015-06-15 19:30         ` Mathieu Desnoyers
2015-06-23 13:46       ` Jan Glauber
2015-06-23 19:46         ` Mathieu Desnoyers
2015-06-23 20:21           ` Mathieu Desnoyers
2015-06-23 21:04             ` Mathieu Desnoyers
2015-06-25  8:08               ` Jan Glauber
2015-06-25 13:00                 ` Mathieu Desnoyers
2015-06-25 13:37                   ` Mathieu Desnoyers
2015-06-25 13:50                     ` Jan Glauber [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=20150625135056.GB25618@hal \
    --to=jan.glauber@gmail.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