]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/AER: Avoid memory allocation in interrupt handling path
authorJon Derrick <jonathan.derrick@intel.com>
Wed, 14 Sep 2016 16:38:55 +0000 (10:38 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 27 Sep 2016 19:30:36 +0000 (14:30 -0500)
commit7c9ef24fcae5b259b478eb33d13bf587a336246c
tree672529777b3c47350a78ed1374dd3a8329737147
parent1924a269fcea5d8c738a9de09591542a977a827c
PCI/AER: Avoid memory allocation in interrupt handling path

When handling AER events, we previously allocated a struct aer_err_info,
processed the error, and freed the struct.  But aer_isr_one_error() is
serialized by rpc_mutex, so we never need more than one copy of the struct,
and the struct is only about 70 bytes, so we're not saving much by
allocating it dynamically.

Embed a struct aer_err_info directly in struct aer_rpc, which is allocated
at probe-time by aer_probe().

[bhelgaas: changelog]
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/aer/aerdrv.h
drivers/pci/pcie/aer/aerdrv_core.c