public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefani Seibold <stefani@seibold.net>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Americo Wang <xiyou.wangcong@gmail.com>
Subject: Re: [PATCH] update fix X86_64 procfs provide stack information for threads
Date: Wed, 04 Nov 2009 13:22:49 +0100	[thread overview]
Message-ID: <1257337369.5594.15.camel@wall-e> (raw)
In-Reply-To: <20091104120019.GK31511@one.firstfloor.org>

Am Mittwoch, den 04.11.2009, 13:00 +0100 schrieb Andi Kleen:
> > This is true, but i think it is better to get an outdated value than a
> > complete wrong value like -1.
> 
> -1 means "I don't know".  I don't think "completely wrong" 
> is the correct term to describe that.
>  
> > The truth is that KSTK_ESP always return an outdated value on a multi
> > core system if the process never do a system call.
> 
> I think not supporting updates on interrupts at least is very poor.
> Unfortunately there's no good way fast path way to detect this I know of
> (that is why I originally added -1 here)
> 

I am sorry, i did not know that was your code. But anyway.

> 
> > Question: is task_pt_regs(task)->sp set in 64 bit mode when the process
> > is blocked in an interrupt? If true, we can add two additional assembly
> > instruction to the system call handler and store the stack pointer into
> > this. Than KSTK_ESP wil be again a simple macro like
> 
> You want to add instructions to one of the hottest kernel paths
> for this hyper-obscure application?  Bad idea.
> 

You complain that the the value is outdated and i told you how you can
get a more accuracy value. I agree that this is bad idea.
 

> My recommendation would be to just deprecate this proc field
> and if anyone really wants that information they can use
> a trivial ptrace() based user program.
> 

I spend a lot of time doing this, it would be nice to give it a change a
fix the KSTK_ESP macro. It will be not only used by my code. It would be
great if we can do this together. 

You have the knowledge, so i will ask my question again:
Is task_pt_regs(task)->sp set in 64 bit mode when the process is block
in an interrupt? 
Is there a way to detected if a process is blocked by an interrupt?

If you answer both with true than i can fix KSTK_ESP without performance
penalty for the rest of the system.

Stefani



  reply	other threads:[~2009-11-04 12:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03  7:31 [PATCH] update fix X86_64 procfs provide stack information for threads Stefani Seibold
2009-11-03  8:28 ` Ingo Molnar
2009-11-03  9:06   ` Stefani Seibold
2009-11-03 18:16     ` Ingo Molnar
2009-11-05  8:19     ` [PATCH] RFC x86_64 more accurate KSTK_ESP implementation Stefani Seibold
2009-11-05 11:08       ` Andi Kleen
2009-11-05 12:11         ` Stefani Seibold
2009-11-08 11:35       ` Ingo Molnar
2009-11-08 12:51         ` Stefani Seibold
2009-11-08 12:55           ` Ingo Molnar
2009-11-08 14:00             ` Stefani Seibold
2009-11-08 16:34               ` H. Peter Anvin
2009-11-08 19:37         ` Andi Kleen
2009-11-05 13:02     ` [PATCH] fix /proc/<pid>/stat stack pointer for kernel threads Stefani Seibold
2009-11-13  8:01     ` [tip:x86/urgent] fs: " Stefani Seibold
2009-11-04 11:17 ` [PATCH] update fix X86_64 procfs provide stack information for threads Andi Kleen
2009-11-04 11:50   ` Stefani Seibold
2009-11-04 12:00     ` Andi Kleen
2009-11-04 12:22       ` Stefani Seibold [this message]
2009-11-04 15:42       ` Stefani Seibold
2009-11-04 22:21       ` Stefani Seibold

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=1257337369.5594.15.camel@wall-e \
    --to=stefani@seibold.net \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiyou.wangcong@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