[lkml]   [2001]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH] Backport of 2.4 ptrace flag to 2.2

> Alan Cox <> writes:
> > The preferable one for performance is certainly to backport the
> > 2.4 changes

This patch against stock 2.2.19 is a backport of the task structure
ptrace flag of Linux 2.4.

It is available at

As we reported a couple weeks ago, under Linux 2.2 ptrace can globally
corrupt the FPU on SMPs. Linus identified the problem as a race
between ptrace and the FPU trap handler over the process flags. The
ptrace flag introduced in 2.4 eliminates the race.

This port is faithful to the 2.4 design. Essentially it:

- Adds a new variable `ptrace' to the task structure;
- Adds new constants for this variable (PT_PTRACED etc.) and removes
the corresponding old ones (PF_PTRACED etc.);
- Replaces every ptrace-context reference to `flags' with a reference
to `ptrace', and updates the constants used accordingly;
- Updates ptrace offset constants, loads, and comparisons in assembly

The patch is complete for all platforms except ARM. On ARM, I didn't
understand the meaning of the offset constants used in the assembly,
so I didn't try to fix them. The patch does include the necessary
changes to C files on ARM.

We have applied (cleanly), compiled (cleanly) and tested the patch on
an x86 SMP, one of the same ones on which we saw FPU corruption. We
have verified that FPU corruption cannot be produced, and that gdb and
strace still function. We have not tested any other platform.

Please direct any questions or problems with the patch to
Victor Zandy <>.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:52    [W:0.026 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site