linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCHv3 00/11] Intermix Lowmem and vmalloc
@ 2014-01-02 21:53 Laura Abbott
  2014-01-02 21:53 ` [RFC PATCHv3 01/11] mce: acpi/apei: Use get_vm_area directly Laura Abbott
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: Laura Abbott @ 2014-01-02 21:53 UTC (permalink / raw)
  To: Andrew Morton, Kyungmin Park, Dave Hansen, linux-mm, Russell King
  Cc: linux-kernel, Laura Abbott

Happy New Year! This is v3 of the series to allow lowmem and vmalloc virtual
address space to be intermixed.

v3: Lots of changes here
 - A bit of code refactoring on the ARM side
 - Fixed Kconfig per Dave Hansen. Changed the name to something slightly more
 descriptive (bike shedding still welcome)
 - changed is_vmalloc_addr to just use a bitmap per suggestions from both Dave
 and Andrew
 - get_vmalloc_info now updated. Given what get_vmalloc_info is actually trying
 to acheive, lowmem regions are omitted from the accounting.
 - VMALLOC_TOTAL now accounted for correctly
 - introduction of for_each_potential_vmalloc_area. This is used for places
 where code needs to do something on each vmalloc range (formerly
 VMALLOC_START, VMALLOC_END)
 - getting rid of users of VMALLOC_START. The decision of which clients to
 change was based on whether VMALLOC_START was being used as the start of
 vmalloc region (converted over) or the end of the direct mapped area
 (left alone).

v2: Fixed several comments by Kyungmin Park which led me to discover
several issues with the is_vmalloc_addr implementation. is_vmalloc_addr
is probably the ugliest part of the entire series and I debated if
adding extra vmalloc flags would make it less ugly.



Currently on 32-bit systems we have


                  Virtual                             Physical

   PAGE_OFFSET   +--------------+     PHYS_OFFSET   +------------+
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 | lowmem       |                   |  direct    |
                 |              |                   |   mapped   |
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 +--------------+------------------>x------------>
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |  not-direct|
                 |              |                   | mapped     |
                 | vmalloc      |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 +--------------+                   +------------+

Where part of the virtual spaced above PAGE_OFFSET is reserved for direct
mapped lowmem and part of the virtual address space is reserved for vmalloc.

Obviously, we want to optimize for having as much direct mapped memory as
possible since there is a penalty for mapping/unmapping highmem. Unfortunately
system constraints often give memory layouts such as

                  Virtual                             Physical

   PAGE_OFFSET   +--------------+     PHYS_OFFSET   +------------+
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |xxxxxxxxxxxx|
                 | lowmem       |                   |xxxxxxxxxxxx|
                 |              |                   |xxxxxxxxxxxx|
                 |              |                   |xxxxxxxxxxxx|
                 |              |                   |            |
                 |              |                   |            |
                 +--------------+------------------>x------------>
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |  not-direct|
                 |              |                   | mapped     |
                 | vmalloc      |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 +--------------+                   +------------+

                 (x = Linux cannot touch this memory)

where part of physical region that would be direct mapped as lowmem is not
actually in use by Linux.

This means that even though the system is not actually accessing the memory
we are still losing that portion of the direct mapped lowmem space. What this
series does is treat the virtual address space that would have been taken up
by the lowmem memory as vmalloc space and allows more lowmem to be mapped



                  Virtual                             Physical

   PAGE_OFFSET   +--------------+     PHYS_OFFSET   +------------+
                 |              |                   |            |
                 | lowmem       |                   |            |
                 <----------------------------------+xxxxxxxxxxxx|
                 |              |                   |xxxxxxxxxxxx|
                 | vmalloc      |                   |xxxxxxxxxxxx|
                 <----------------------------------+xxxxxxxxxxxx|
                 |              |                   |            |
                 | lowmem       |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 |              |                   |            |
                 +----------------------------------------------->
                 | vmalloc      |                   |            |
                 |              |                   |  not-direct|
                 |              |                   | mapped     |
                 |              |                   |            |
                 +--------------+                   +------------+

The goal here is to allow as much lowmem to be mapped as if the block of memory
was not reserved from the physical lowmem region. Previously, we had been
hacking up the direct virt <-> phys translation to ignore a large region of
memory. This did not scale for multiple holes of memory however.

Open issues:
	- vmalloc=<size> will account for all vmalloc now. This may have the
	side effect of shrinking 'traditional' vmalloc too much for regular
	static mappings. We were debating if this is just part of finding the
	correct size for vmalloc or if there is a need for vmalloc_upper=
	- People who like bike shedding more than I do can suggest better
	config names if there is sufficient interest in the series.


Laura Abbott (11):
  mce: acpi/apei: Use get_vm_area directly
  iommu/omap: Use get_vm_area directly
  percpu: use VMALLOC_TOTAL instead of VMALLOC_END - VMALLOC_START
  dm: Use VMALLOC_TOTAL instead of VMALLCO_END - VMALLOC_START
  staging: lustre: Use is_vmalloc_addr
  arm: use is_vmalloc_addr
  arm: mm: Add iotable_init_novmreserve
  mm/vmalloc.c: Allow lowmem to be tracked in vmalloc
  arm: mm: Track lowmem in vmalloc
  arm: Use for_each_potential_vmalloc_area
  fs/proc/kcore.c: Use for_each_potential_vmalloc_area

 arch/arm/Kconfig                                   |    3 +
 arch/arm/include/asm/mach/map.h                    |    2 +
 arch/arm/kvm/mmu.c                                 |   12 ++-
 arch/arm/mm/dma-mapping.c                          |    2 +-
 arch/arm/mm/init.c                                 |  104 ++++++++++++-----
 arch/arm/mm/iomap.c                                |    3 +-
 arch/arm/mm/ioremap.c                              |   17 ++-
 arch/arm/mm/mm.h                                   |    3 +-
 arch/arm/mm/mmu.c                                  |   55 ++++++++-
 drivers/acpi/apei/ghes.c                           |    4 +-
 drivers/iommu/omap-iovmm.c                         |    2 +-
 drivers/md/dm-bufio.c                              |    4 +-
 drivers/md/dm-stats.c                              |    2 +-
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |    3 +-
 fs/proc/kcore.c                                    |   20 +++-
 include/linux/mm.h                                 |    6 +
 include/linux/vmalloc.h                            |   31 +++++
 mm/Kconfig                                         |    6 +
 mm/percpu.c                                        |    4 +-
 mm/vmalloc.c                                       |  119 +++++++++++++++++---
 20 files changed, 320 insertions(+), 82 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-01-12  3:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-02 21:53 [RFC PATCHv3 00/11] Intermix Lowmem and vmalloc Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 01/11] mce: acpi/apei: Use get_vm_area directly Laura Abbott
2014-01-03  2:33   ` Chen, Gong
2014-01-02 21:53 ` [RFC PATCHv3 02/11] iommu/omap: " Laura Abbott
2014-01-03  2:40   ` Chen, Gong
2014-01-02 21:53 ` [RFC PATCHv3 03/11] percpu: use VMALLOC_TOTAL instead of VMALLOC_END - VMALLOC_START Laura Abbott
2014-01-12  3:39   ` Tejun Heo
2014-01-02 21:53 ` [RFC PATCHv3 04/11] dm: Use VMALLOC_TOTAL instead of VMALLCO_END " Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 05/11] staging: lustre: Use is_vmalloc_addr Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 06/11] arm: use is_vmalloc_addr Laura Abbott
2014-01-02 22:13   ` Dave Hansen
2014-01-02 21:53 ` [RFC PATCHv3 07/11] arm: mm: Add iotable_init_novmreserve Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 08/11] mm/vmalloc.c: Allow lowmem to be tracked in vmalloc Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 09/11] arm: mm: Track lowmem " Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 10/11] arm: Use for_each_potential_vmalloc_area Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 11/11] fs/proc/kcore.c: " Laura Abbott
2014-01-03 18:23 ` [RFC PATCHv3 00/11] Intermix Lowmem and vmalloc Dave Hansen
2014-01-03 22:08   ` Laura Abbott
2014-01-04  7:31     ` Minchan Kim
2014-01-06 19:08       ` Laura Abbott
2014-01-08  2:52         ` Minchan Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).