public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* copy to user
@ 2001-11-20 20:54 Luis Miguel Correia Henriques
  2001-11-20 21:28 ` John Alvord
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Luis Miguel Correia Henriques @ 2001-11-20 20:54 UTC (permalink / raw)
  To: linux-kernel

The reason that I need it to spend CPU time is that I'm developing a fault
injector. The purpose of a fault injection tool is, as you could imagine,
to test some critical systems and it's capacity to recover from fails. The
reason for changing the code of a process is that process must be delayed
but without leaving the CPU - everything must look like nothing wrong is
happening, except for other processes that are waiting for something from
the delayed process...

Maybe I should have explained this before... sorry.

I suppose now you can understand why SIGSTOP won't work. Hope you can help
me :)

About using udelay... this soluction seemed fine to me at first but if I
hang the CPU with udelay the scheduler will no be doing it's job (isn't
it?). This would give me even more intrusiveness (another requirement: the
less intrusiveness as possible).

Isn't there any doubt that copy_to_user can handle my problem? When I use
it to change CS, this function returns the correct number of bytes (and no
error) but, when I try to read... the old data is still there. I suppose
there is a page/segment protection against writing to CS, isn't it?

Luis Henriques


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: copy to user
@ 2001-11-25 21:58 Marco C. Mason
  0 siblings, 0 replies; 9+ messages in thread
From: Marco C. Mason @ 2001-11-25 21:58 UTC (permalink / raw)
  To: umiguel, linux-kernel

Luis Henriques--

Before making my suggestion: Apologies to the list if this has already
been settled.  I'm trying to catch up on my LKML reading, and I'm only
up to Nov 20 so far...

Anyway:  Here's what I'd do, if I had to do such a apalling thing  8^)

Drop a function in your code something like:

_xyzzy:
    db 0x18, 0xfe    ; jr $

Then, when you detect the condition where you want to waste time, then
put the address of this function on top of the user stack (along with
whatever else in the stack frame is required) so that the code just sits
there burning CPU.  To clean it up, you'd simply restore the original
stack frame to the process.

It's hideous & gross, but if you need it.....

--marco



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

end of thread, other threads:[~2001-11-25 21:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-20 20:54 copy to user Luis Miguel Correia Henriques
2001-11-20 21:28 ` John Alvord
2001-11-20 21:44 ` Andreas Dilger
2001-11-21 11:02   ` Luís Henriques
2001-11-20 22:02 ` n0ano
2001-11-20 22:05 ` Chris Wright
2001-11-21  8:43 ` Mathijs Mohlmann
2001-11-21 10:12   ` Jan Hudec
  -- strict thread matches above, loose matches on Subject: below --
2001-11-25 21:58 Marco C. Mason

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