public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* get_current is __pure__, maybe __const__ even
@ 2004-09-15 22:50 Albert Cahalan
  2004-09-15 23:15 ` Jakub Jelinek
  2004-09-15 23:27 ` William Lee Irwin III
  0 siblings, 2 replies; 19+ messages in thread
From: Albert Cahalan @ 2004-09-15 22:50 UTC (permalink / raw)
  To: linux-kernel mailing list; +Cc: ak

Andi Kleen writes:

> Please CSE "current" manually. It generates
> much better code on some architectures
> because the compiler cannot do it for you.

This looks fixable.

At the very least, __attribute__((__pure__))
will apply to your get_current function.

I think __attribute__((__const__)) will too,
even though it's technically against the
documentation. While you do indeed read from
memory, you don't read from memory that could
be seen as changing. Nothing done during the
lifetime of a task will change "current" as
viewed from within that task.



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2004-09-16 19:27 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2ER4z-46B-17@gated-at.bofh.it>
2004-09-16  6:58 ` get_current is __pure__, maybe __const__ even Andi Kleen
2004-09-16 13:43   ` Albert Cahalan
2004-09-16 14:14   ` Albert Cahalan
2004-09-16 19:27     ` Andi Kleen
2004-09-15 22:50 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
2004-09-15 23:27 ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox