diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-09-08 20:53:04 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-09-08 20:53:04 -0400 |
commit | 162b96e63e518aa6ff029ce23de12d7f027483bf (patch) | |
tree | 532191d0cef7cf975b70a07b1c69a293d6f552f7 /drivers/dma/ioat/pci.c | |
parent | 0803172778901e24a75ab074798d98c2b7411559 (diff) |
ioat2,3: cacheline align software descriptor allocations
All the necessary fields for handling an ioat2,3 ring entry can fit into
one cacheline. Move ->len prior to ->txd in struct ioat_ring_ent, and
move allocation of these entries to a hw-cache-aligned kmem cache to
reduce the number of cachelines dirtied for descriptor management.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/ioat/pci.c')
-rw-r--r-- | drivers/dma/ioat/pci.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/dma/ioat/pci.c b/drivers/dma/ioat/pci.c index c4e432269252..61086c6bbf42 100644 --- a/drivers/dma/ioat/pci.c +++ b/drivers/dma/ioat/pci.c | |||
@@ -69,6 +69,8 @@ static int ioat_dca_enabled = 1; | |||
69 | module_param(ioat_dca_enabled, int, 0644); | 69 | module_param(ioat_dca_enabled, int, 0644); |
70 | MODULE_PARM_DESC(ioat_dca_enabled, "control support of dca service (default: 1)"); | 70 | MODULE_PARM_DESC(ioat_dca_enabled, "control support of dca service (default: 1)"); |
71 | 71 | ||
72 | struct kmem_cache *ioat2_cache; | ||
73 | |||
72 | #define DRV_NAME "ioatdma" | 74 | #define DRV_NAME "ioatdma" |
73 | 75 | ||
74 | static struct pci_driver ioat_pci_driver = { | 76 | static struct pci_driver ioat_pci_driver = { |
@@ -168,12 +170,24 @@ static void __devexit ioat_remove(struct pci_dev *pdev) | |||
168 | 170 | ||
169 | static int __init ioat_init_module(void) | 171 | static int __init ioat_init_module(void) |
170 | { | 172 | { |
171 | return pci_register_driver(&ioat_pci_driver); | 173 | int err; |
174 | |||
175 | ioat2_cache = kmem_cache_create("ioat2", sizeof(struct ioat_ring_ent), | ||
176 | 0, SLAB_HWCACHE_ALIGN, NULL); | ||
177 | if (!ioat2_cache) | ||
178 | return -ENOMEM; | ||
179 | |||
180 | err = pci_register_driver(&ioat_pci_driver); | ||
181 | if (err) | ||
182 | kmem_cache_destroy(ioat2_cache); | ||
183 | |||
184 | return err; | ||
172 | } | 185 | } |
173 | module_init(ioat_init_module); | 186 | module_init(ioat_init_module); |
174 | 187 | ||
175 | static void __exit ioat_exit_module(void) | 188 | static void __exit ioat_exit_module(void) |
176 | { | 189 | { |
177 | pci_unregister_driver(&ioat_pci_driver); | 190 | pci_unregister_driver(&ioat_pci_driver); |
191 | kmem_cache_destroy(ioat2_cache); | ||
178 | } | 192 | } |
179 | module_exit(ioat_exit_module); | 193 | module_exit(ioat_exit_module); |