Trouble with start_bh_atomic() locks and SMP.

Roman Mitnitski (roman@checkpoint.com)
Tue, 4 Jan 2000 17:41:19 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_018F_01BF56DA.E8538470
Content-Type: text/plain;
charset="windows-1255"
Content-Transfer-Encoding: quoted-printable

Hi everyone.

I am trying to figure out why I'm having the following problem on SMP =
machines
(with kernel 2.2.13)

I have the kernel module build like this:

ioctl_handle() and read_handle() both build like this:
{
start_bh_atomic();
<CODE>
end_bh_atomic();
}

Code that sits before ip_rcv() (done with dev_add_pack())=20
looks the same:
{
start_bh_atomic()
<CODE>
end_bh_atomic()
}

and code that hooks to net device's dev->output() function looking that =
same way.

The user-mode program runs ioctls and reads once in a while.

On single-CPU system it works like charm. On dual-CPU, it works, but =
under heavy
network traffic the system suddently slows to the crawl, indicating that =
my user-level process
spends too much CPU in "system" (my guess - in the IOCTLs/READs)

Does anyone have any clues?
Replacing the code with simple spin_unlock_irqrestore() and =
spin_lock_irqsave()
makes things better, but it does not seem "right".

Thanks in advance.

Roman.

------=_NextPart_000_018F_01BF56DA.E8538470
Content-Type: text/html;
charset="windows-1255"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

 
 
   Hi everyone.
 
 I am trying to figure = out why I'm=20 having the following problem on SMP machines
(with kernel = 2.2.13)
 
 
I have the kernel module = build like=20 this:
 
ioctl_handle() and = read_handle() both=20 build like this:
{
   =20 start_bh_atomic();
   = <CODE>
  =20 end_bh_atomic();
}
 
Code that sits before ip_rcv() = (done with=20 dev_add_pack())
looks the same:
{
 start_bh_atomic()
 <CODE>
 end_bh_atomic()
}
 
and code that hooks to net = device's=20 dev->output() function looking that same way.
 
The user-mode program runs ioctls and = reads once in=20 a while.
 
On single-CPU system it = works like=20 charm. On dual-CPU, it works, but under heavy
network traffic the system = suddently=20 slows to the crawl, indicating that my user-level process
spends too much CPU in = "system" (my=20 guess - in the IOCTLs/READs)
 
 
Does anyone have any = clues?
Replacing the code with simple=20 spin_unlock_irqrestore() and spin_lock_irqsave()
makes things better, but it = does not=20 seem "right".
 
Thanks in = advance.
 
Roman.
 
 
------=_NextPart_000_018F_01BF56DA.E8538470-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/