Commit e2a8f20
Crash: add lock to serialize crash hotplug handling
Eric reported that handling corresponding crash hotplug event can be
failed easily when many memory hotplug event are notified in a short
period. They failed because failing to take __kexec_lock.
=======
[ 78.714569] Fallback order for Node 0: 0
[ 78.714575] Built 1 zonelists, mobility grouping on. Total pages: 1817886
[ 78.717133] Policy zone: Normal
[ 78.724423] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
[ 78.727207] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
[ 80.056643] PEFILE: Unsigned PE binary
=======
The memory hotplug events are notified very quickly and very many, while
the handling of crash hotplug is much slower relatively. So the atomic
variable __kexec_lock and kexec_trylock() can't guarantee the
serialization of crash hotplug handling.
Here, add a new mutex lock __crash_hotplug_lock to serialize crash hotplug
handling specifically. This doesn't impact the usage of __kexec_lock.
Link: https://lkml.kernel.org/r/20230926120905.392903-1-bhe@redhat.com
Fixes: 2472627 ("crash: add generic infrastructure for crash hotplug support")
Signed-off-by: Baoquan He <bhe@redhat.com>
Tested-by: Eric DeVolder <eric.devolder@oracle.com>
Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent bbe246f commit e2a8f20
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
742 | 753 | | |
743 | 754 | | |
744 | 755 | | |
| |||
748 | 759 | | |
749 | 760 | | |
750 | 761 | | |
| 762 | + | |
751 | 763 | | |
752 | 764 | | |
753 | 765 | | |
| 766 | + | |
754 | 767 | | |
755 | 768 | | |
756 | 769 | | |
| |||
761 | 774 | | |
762 | 775 | | |
763 | 776 | | |
| 777 | + | |
764 | 778 | | |
765 | 779 | | |
766 | 780 | | |
| |||
783 | 797 | | |
784 | 798 | | |
785 | 799 | | |
| 800 | + | |
786 | 801 | | |
787 | 802 | | |
788 | 803 | | |
| 804 | + | |
789 | 805 | | |
790 | 806 | | |
791 | 807 | | |
| |||
852 | 868 | | |
853 | 869 | | |
854 | 870 | | |
| 871 | + | |
855 | 872 | | |
856 | 873 | | |
857 | 874 | | |
| |||
0 commit comments