Date: Wed, 22 Jan 2014 10:00:27 +0530 From: vadiraj cs <abacusv81@gmail.com> To: freebsd-drivers@freebsd.org Subject: bus_alloc_resource() is degrading the system performance Message-ID: <CAMxSDhs3cGW=E5-13jAy5RF2LDWbzBb2ENt5Wms=b2MwHwoibQ@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi All, I'm writing a driver for a PCI device and allocating bus resource through call bus_alloc_resource(). I see that doing this is making my system performance go down. Here is the dd output before loading my module and soon after loading my module. I'm running dd on a ramdisk before and after loading the module. Before module load--- #dd if=/dev/zero of=/dev/md0 bs=4k count=10k 10240+0 records in 10240+0 records out 41943040 bytes transferred in 0.256835 secs (163307348 bytes/sec) After module load----------- # dd if=/dev/zero of=/dev/md0 bs=4k count=10k 10240+0 records in 10240+0 records out 41943040 bytes transferred in 5.162754 secs (8124160 bytes/sec) Why dd? The device for which I'm writing a driver is a nvram pci card. Hence this will be storage device. The performance of this disk is way low. I suspected the driver. But once the driver is loaded even the ramdisk starts performing low. After some debugging I realized that allocating bus resource is causing this behavior. The size reserved varied from 512 bytes to 512K. There was no change in the behavior. So resource size is not an issue. Parameters passed to bus_alloc_resource(). reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, ®_bar_id, 0UL, ~0UL, 512, RF_ACTIVE); Any pointers to this will be of great help. Thanks,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMxSDhs3cGW=E5-13jAy5RF2LDWbzBb2ENt5Wms=b2MwHwoibQ>