Files
android_kernel_xiaomi_sm8450/include/linux
Pavel Tatashin d0dc12e86b mm/memory_hotplug: optimize memory hotplug
During memory hotplugging we traverse struct pages three times:

1. memset(0) in sparse_add_one_section()
2. loop in __add_section() to set do: set_page_node(page, nid); and
   SetPageReserved(page);
3. loop in memmap_init_zone() to call __init_single_pfn()

This patch removes the first two loops, and leaves only loop 3.  All
struct pages are initialized in one place, the same as it is done during
boot.

The benefits:

 - We improve memory hotplug performance because we are not evicting the
   cache several times and also reduce loop branching overhead.

 - Remove condition from hotpath in __init_single_pfn(), that was added
   in order to fix the problem that was reported by Bharata in the above
   email thread, thus also improve performance during normal boot.

 - Make memory hotplug more similar to the boot memory initialization
   path because we zero and initialize struct pages only in one
   function.

 - Simplifies memory hotplug struct page initialization code, and thus
   enables future improvements, such as multi-threading the
   initialization of struct pages in order to improve hotplug
   performance even further on larger machines.

[pasha.tatashin@oracle.com: v5]
  Link: http://lkml.kernel.org/r/20180228030308.1116-7-pasha.tatashin@oracle.com
Link: http://lkml.kernel.org/r/20180215165920.8570-7-pasha.tatashin@oracle.com
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Steven Sistare <steven.sistare@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-05 21:36:25 -07:00
..
2018-02-14 09:43:22 -08:00
2017-11-28 16:30:38 +01:00
2018-01-01 22:54:42 -08:00
2018-02-20 11:34:54 +00:00
2018-03-08 13:56:24 +05:30
2018-03-29 14:29:55 -04:00
2018-03-16 10:56:13 +01:00
2018-03-31 02:15:18 +02:00
2018-03-31 02:16:26 +02:00
2018-03-31 02:14:44 +02:00
2017-11-15 18:21:04 -08:00
2017-12-19 16:35:34 -08:00
2018-01-03 14:03:48 +01:00
2018-03-16 10:55:47 +01:00
2018-03-26 15:09:38 +02:00
2017-11-27 16:19:56 -05:00
2018-03-12 10:05:01 +01:00
2018-01-01 12:40:27 -07:00
2018-01-25 14:10:39 -08:00
2018-03-26 15:56:44 +02:00
2018-03-31 02:15:18 +02:00
2017-11-13 01:41:20 +01:00
2018-02-26 09:48:42 -07:00
2017-11-15 18:21:06 -08:00
2018-01-16 00:04:19 +01:00
2018-02-06 16:41:29 -05:00
2018-02-22 21:13:03 +01:00
2018-01-17 11:30:16 +00:00
2017-11-15 18:21:01 -08:00
2018-02-24 01:43:47 +01:00
2018-03-13 13:29:10 -07:00
2017-12-01 13:09:40 -08:00
2017-10-07 10:45:02 -06:00
2018-01-03 11:00:22 -05:00
2018-01-31 17:18:38 -08:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-30 12:56:22 -04:00
2017-11-17 16:10:00 -08:00
2018-01-28 22:17:24 -05:00
2018-01-08 08:22:45 -06:00
2018-01-17 15:25:50 +01:00
2018-01-08 08:22:45 -06:00
2017-12-14 16:00:49 -08:00
2017-11-15 18:21:06 -08:00
2018-01-31 17:18:37 -08:00
2017-11-09 10:23:28 +01:00
2018-02-01 11:40:07 -06:00
2018-01-19 16:50:53 -08:00
2017-11-17 16:10:04 -08:00
2017-11-17 16:10:04 -08:00
2017-11-13 01:33:48 +01:00
2017-12-16 02:05:48 +01:00
2018-02-06 16:41:28 -05:00
2018-02-20 16:12:26 -08:00
2017-12-11 14:37:11 -07:00
2017-11-29 22:16:31 +01:00
2017-11-07 12:22:21 +01:00
2018-01-29 12:02:54 -05:00
2018-04-05 21:36:24 -07:00
2018-04-05 21:36:24 -07:00
2018-01-18 11:56:49 +01:00
2018-01-15 12:07:46 -08:00
2018-02-06 18:32:47 -08:00
2018-01-09 16:27:43 +01:00
2018-02-20 16:10:25 -08:00
2017-10-11 22:36:54 -04:00
2018-02-06 18:32:44 -08:00
2017-12-20 09:53:54 -07:00
2017-10-04 10:29:22 +02:00