diff options
author | thompsa <thompsa@FreeBSD.org> | 2009-01-13 19:03:23 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2009-01-13 19:03:23 +0000 |
commit | 0dee809a2dea5c22e790f798c8991d6c47584e93 (patch) | |
tree | 3fed8d0a87880180cb9be6db99f655c4f0d9335b /sys/dev/usb2/controller/usb2_controller.c | |
parent | 4a6646160afda48ebd262b9548fc477b9629a141 (diff) | |
download | FreeBSD-src-0dee809a2dea5c22e790f798c8991d6c47584e93.zip FreeBSD-src-0dee809a2dea5c22e790f798c8991d6c47584e93.tar.gz |
MFp4: //depot/projects/usb@155842
Reduce the number of callback processes to 4 per
USB controller. There are two rough categories:
1) Giant locked USB transfers.
2) Non-Giant locked USB transfers.
On a real system with many USB devices plugged in the
number of processes reported by "ps auxw | grep USBPROC"
was reduced from 40 to 18.
Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb2/controller/usb2_controller.c')
-rw-r--r-- | sys/dev/usb2/controller/usb2_controller.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/usb2/controller/usb2_controller.c b/sys/dev/usb2/controller/usb2_controller.c index 61ce314..a9596c7 100644 --- a/sys/dev/usb2/controller/usb2_controller.c +++ b/sys/dev/usb2/controller/usb2_controller.c @@ -166,6 +166,11 @@ usb2_detach(device_t dev) USB_BUS_UNLOCK(bus); + /* Get rid of USB callback processes */ + + usb2_proc_unsetup(&bus->giant_callback_proc); + usb2_proc_unsetup(&bus->non_giant_callback_proc); + /* Get rid of USB roothub process */ usb2_proc_unsetup(&bus->roothub_proc); @@ -391,8 +396,17 @@ usb2_attach_sub(device_t dev, struct usb2_bus *bus) bus->roothub_msg[1].hdr.pm_callback = &usb2_bus_roothub; bus->roothub_msg[1].bus = bus; - /* Create USB explore and roothub processes */ - if (usb2_proc_setup(&bus->roothub_proc, + /* Create USB explore, roothub and callback processes */ + + if (usb2_proc_setup(&bus->giant_callback_proc, + &bus->bus_mtx, USB_PRI_MED)) { + printf("WARNING: Creation of USB Giant " + "callback process failed.\n"); + } else if (usb2_proc_setup(&bus->non_giant_callback_proc, + &bus->bus_mtx, USB_PRI_HIGH)) { + printf("WARNING: Creation of USB non-Giant " + "callback process failed.\n"); + } else if (usb2_proc_setup(&bus->roothub_proc, &bus->bus_mtx, USB_PRI_HIGH)) { printf("WARNING: Creation of USB roothub " "process failed.\n"); |