public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Pekka Paalanen <pq@iki.fi>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, vegard.nossum@gmail.com
Subject: Re: [BUG/PATCH] x86 mmiotrace: dynamically disable non-boot CPUs
Date: Wed, 16 Apr 2008 13:46:09 +0200	[thread overview]
Message-ID: <20080416114609.GA20054@elte.hu> (raw)
In-Reply-To: <20080414210242.2329997d@daedalus.pq.iki.fi>


* Pekka Paalanen <pq@iki.fi> wrote:

> > we should fix this restriction ASAP. Forcibly dropping to UP will 
> > cause mmiotrace to be much less useful for diagnostic purposes of 
> > Linux
> 
> Ok, how do you propose we solve this?
> 
> I have asked the question before, and then I had two ideas. Well, the
> first one was actually your idea (so I hear) to solve the same problem for
> kmemcheck.
> - per-cpu page tables
> - instead of single-stepping, emulate the faulting instruction and never
> disarm pages during tracing. (Use and modify code from KVM.)
> 
> I don't believe either of these is easy or fast to implement. Given 
> some months, I might be able to achieve emulation. Page tables are 
> still magic to me.

yeah - it looks complex. Not a showstopper for now :-)

but given that Xorg is usually just a single task, do we _really_ need 
this?

> > drivers. We want to enable the mmiotrace-ing of specific devices via 
> > some /sys flag. For example via:
> > 
> >    cat /sys/devices/pci0000\:00/0000\:00\:1f.2/mmiotrace
> > 
> > this should start mmiotracing of that specific device - or something 
> > like that. Hm?
> 
> Ooh, that sounds like a neat interface. I like it. I've been 
> half-thinking of different ways of specifying the set of devices to 
> trace, but none of them was particularly nice. This feature is for 
> post-2.6.26, right?

yeah, most likely.

> Ok, so first select mmiotrace tracer, at which point those sysfs files 
> appear, but mmiotrace is not activated yet. Then, when any of the 
> device specific files, or the global file in debugfs, is opened, 
> mmiotrace activates. And if the file is closed, mmiotrace deactivates.

sounds good to me!

> Should we support several "cats" at the same time?

if it's possible ...

> > i suspect the bug is that you bring the CPU down from an atomic 
> > (spinlocked or irq disabled) context.
> 
> Hmm, it should not be... I have to double-check, but all the other 
> code, too, from where enter_uniprocessor() is called, may sleep. The 
> first thing the caller does is to acquire a mutex, which I assume 
> would complain loudly if spinlocked or irq-disabled.
> 
> Ingo, thank you for fixing this patch, though I'd like to suggest to 
> leave it out for now, since there clearly are worse problems with it 
> than without it. And if we can solve the SMP issue, this is not 
> needed. For the time being we can just instruct users to disable all 
> but one CPU when try want to trace.

i think we still need to make this as 'transparent' to users as 
possible. Disabling CPUs can be tedious.

are lost events really a problem in practice, given Xorg's 
single-threadedness?

i'm leaving out this patch from the series for now.

	Ingo

  reply	other threads:[~2008-04-16 11:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080413224207.4430a09c@daedalus.pq.iki.fi>
2008-04-13 19:48 ` [PATCH] mmiotrace: add user documentation Pekka Paalanen
2008-04-14 15:49   ` Steven Rostedt
2008-04-14 18:20     ` Pekka Paalanen
2008-04-13 20:05 ` [BUG/PATCH] x86 mmiotrace: dynamically disable non-boot CPUs Pekka Paalanen
2008-04-14  6:57   ` Ingo Molnar
2008-04-14 18:02     ` Pekka Paalanen
2008-04-16 11:46       ` Ingo Molnar [this message]
2008-04-16 17:59         ` Pekka Paalanen
2008-04-16 18:32           ` Ingo Molnar
2008-04-16 19:07             ` Steven Rostedt
2008-04-16 20:42             ` Pekka Paalanen
2008-04-16 20:47               ` Ingo Molnar
2008-07-24 15:34           ` [Nouveau] " Stephane Marchesin
2008-04-19 15:41     ` [BUG] kmalloc_node(GFP_KERNEL) while smp_alt spinlocked Pekka Paalanen
2008-04-19 16:19       ` [PATCH] Fix SMP alternatives : use mutex instead of spinlock, text_poke is sleepable Mathieu Desnoyers
2008-04-19 21:06         ` Pekka Paalanen
2008-04-19 21:52           ` [BUG] CPU hotplug reboots machine (Re: [PATCH] Fix SMP alternatives : use mutex instead of spinlock, text_poke is sleepable) Pekka Paalanen
2008-04-19 21:58             ` [PATCH] Check for breakpoint in text_poke to eliminate bug_on Mathieu Desnoyers
2008-04-19 22:42               ` Pekka Paalanen
2008-04-20  0:05                 ` Mathieu Desnoyers
2008-04-20  7:14                   ` Pekka Paalanen
2008-04-20 19:44                     ` Mathieu Desnoyers
2008-04-20 20:18                       ` Pekka Paalanen
2008-04-20 20:25                         ` Mathieu Desnoyers
2008-04-21 18:48                           ` [PATCH] x86_64: fix kernel rodata NX setting Pekka Paalanen
2008-04-21 18:57                             ` Steven Rostedt
2008-04-21 19:03                             ` Ingo Molnar
2008-04-22 18:42         ` [repost PATCH] Fix SMP alternatives : use mutex instead of spinlock, text_poke is sleepable Pekka Paalanen
2008-04-22 19:09           ` Ingo Molnar
2008-04-22 20:22             ` Mathieu Desnoyers
2008-04-24 19:39   ` [PATCH v2] x86 mmiotrace: dynamically disable non-boot CPUs Pekka Paalanen
2008-04-26 11:13     ` Ingo Molnar

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=20080416114609.GA20054@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pq@iki.fi \
    --cc=rostedt@goodmis.org \
    --cc=vegard.nossum@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