public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Agner Fog <agner@agner.org>
Cc: Andi Kleen <andi@firstfloor.org>,
	Arjan van de Ven <arjan@infradead.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: ABI change for device drivers using future AVX instruction set
Date: Sat, 28 Jun 2008 22:02:31 +0200	[thread overview]
Message-ID: <20080628200231.GA21259@one.firstfloor.org> (raw)
In-Reply-To: <4866541F.1060709@agner.org>

> This info is not in the "Unreliable Guide To Hacking The Linux Kernel" 

The unreliable guide is a little outdated.

> or anywhere else except deeply hidden in the archives of this mailing 

Normally all introductions of kernel programming (like
the classic "Linux device drivers") should document that FPU code
is not allowed. The kernel also enforces that by passing special
compiler optionsthat cause compiler errors for FPU and SSE code.
You have to explicitely override those.

> list. I had to actually look into the source code of kernel_fpu_begin to 
> verify that it saves not only the FPU but also the XMM registers and 
> that it disables pre-emption.

The requirement to disable preemption is one reason why XMM in 
a driver is not a good idea BTW.  XMM should be normally only
used when you plan to spend a lot of CPU cycles (otherwise
the cost of saving the state is not amortized by the improvements).

But keeping preemption disabled for a long time is considered
unfriendly because it increases kernel latencies and might 
in the worst case cause visible scheduling problems like skipping audio
etc. 

> You see why I want proper documentation? If this had been documented in 
> some reference that was easy to find, I wouldn't have needed to take 
> your time with all these questions...

Yes agreed the documentation could be better. The standard Linux
reference documentation is "kerneldoc" which you can generate from the 
kernel source with make pdfdocs/mandocs/htmldocs
(some distributions ship pregenerated docs in a separate kernel-docs package)

Unfortunately kerneldoc documents a lot of obscure unimportant
functions, but doesn't document important functionality like
kernel_fpu_begin/end (or even important functions like kmalloc!)

There's a new editor for kernel documentation now so things might
improve.

-Andi


  parent reply	other threads:[~2008-06-28 19:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 15:32 ABI change for device drivers using future AVX instruction set Agner Fog
2008-06-25 16:22 ` Arjan van de Ven
2008-06-25 19:54   ` Agner Fog
2008-06-25 20:09     ` Arjan van de Ven
2008-06-26  1:11   ` H. Peter Anvin
2008-06-27 11:31     ` Agner Fog
2008-06-27 14:22       ` Arjan van de Ven
2008-06-28  8:05         ` Agner Fog
2008-06-28  8:10           ` David Miller
2008-06-28 11:47           ` Andi Kleen
2008-06-28 15:09             ` Agner Fog
2008-06-28 15:44               ` Helge Hafting
2008-06-28 20:02               ` Andi Kleen [this message]
2008-06-29 11:33                 ` Avi Kivity
2008-06-29 12:21                   ` Andi Kleen
2008-06-29 12:31                     ` Avi Kivity
2008-06-29 13:07                       ` Andi Kleen
2008-06-29 13:18                         ` Avi Kivity
2008-06-29 13:23                           ` Andi Kleen
2008-06-29 13:29                             ` Avi Kivity
2008-06-29 22:08                             ` H. Peter Anvin
2008-06-29 12:29           ` Alan Cox
2008-07-01 15:30           ` Arjan van de Ven
2008-06-25 20:14 ` Alan Cox
2008-06-26 14:01 ` 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=20080628200231.GA21259@one.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=agner@agner.org \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /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