All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Andi Kleen <ak@muc.de>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	Albert Cahalan <albert@users.sf.net>,
	Jakub Jelinek <jakub@redhat.com>,
	Albert Cahalan <albert@users.sourceforge.net>,
	linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: get_current is __pure__, maybe __const__ even
Date: Thu, 16 Sep 2004 15:36:16 +0100	[thread overview]
Message-ID: <20040916153616.D31029@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20040916110355.GA20448@muc.de>; from ak@muc.de on Thu, Sep 16, 2004 at 01:03:55PM +0200

On Thu, Sep 16, 2004 at 01:03:55PM +0200, Andi Kleen wrote:
> > The scheduler quite rightly expects, for any thread, that any variable
> > which may be stored in a CPU register before the context switch has the
> > same value as after the context switch.
> 
> Just current isn't a varible, it's some inline assembly in a inline
> function.  The question was if that function could be marked const/pure. 

Sigh.  What does that matter?

current_thread, which is what we should be talking about here, is
indeed a function, but its returned value depends wholely on the
stack pointer value.

Since the stack pointer and thread info are invariably coupled
together, it is right to mark it const/pure.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  reply	other threads:[~2004-09-16 14:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-15 22:50 get_current is __pure__, maybe __const__ even Albert Cahalan
2004-09-15 23:15 ` Jakub Jelinek
2004-09-15 23:29   ` William Lee Irwin III
2004-09-16  2:10     ` Albert Cahalan
2004-09-16  2:36       ` William Lee Irwin III
2004-09-16  2:47         ` Nick Piggin
2004-09-16  3:23           ` William Lee Irwin III
2004-09-16  3:49         ` Albert Cahalan
2004-09-16  3:59           ` William Lee Irwin III
2004-09-16  9:04         ` Russell King
2004-09-16  9:11           ` Andi Kleen
2004-09-16  9:30             ` Russell King
2004-09-16 11:03               ` Andi Kleen
2004-09-16 14:36                 ` Russell King [this message]
2004-09-15 23:27 ` William Lee Irwin III
     [not found] <2ER4z-46B-17@gated-at.bofh.it>
2004-09-16  6:58 ` Andi Kleen
2004-09-16 13:43   ` Albert Cahalan
2004-09-16 14:14   ` Albert Cahalan
2004-09-16 19:27     ` Andi Kleen

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=20040916153616.D31029@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=ak@muc.de \
    --cc=albert@users.sf.net \
    --cc=albert@users.sourceforge.net \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wli@holomorphy.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.