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)
commit4b202b716e4e282c26c4a95952ea33e318c363ab
tree672529777b3c47350a78ed1374dd3a8329737147
parent2458d66b245e39786bc5b51062e6d30aa5ad0282
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