linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux-foundation.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>,
	Minchan Kim <minchan.kim@gmail.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Milton Miller <miltonm@bga.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mel@csn.ul.ie>, Johannes Weiner <hannes@cmpxchg.org>,
	Kukjin Kim <kgene.kim@samsung.com>
Subject: Re: [PATCH] Tight check of pfn_valid on sparsemem - v4
Date: Thu, 29 Jul 2010 17:28:14 -0500 (CDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1007291723310.21024@router.home> (raw)
In-Reply-To: <20100729221426.GA28699@n2100.arm.linux.org.uk>

On Thu, 29 Jul 2010, Russell King - ARM Linux wrote:

> We don't map lowmem in using 4K pages.  That would be utter madness
> given the small TLB size ARM processors tend to have.  Instead, we
> map lowmem using 1MB section mappings (which occupy one entry in the
> L1 page table.)  Modifying these mappings requires all page tables
> in the system to be updated - which given that we're SMP etc. now
> is not practical.
>
> So the idea that we can remap a section of memory for the mem_map
> struct (as suggested several times in this thread) isn't possible
> without having it allocated in something like vmalloc space.
> Plus, of course, that if you did such a remapping in the lowmem
> mapping, the pages which were there become unusable as they lose
> their virtual mapping (thereby causing phys_to_virt/virt_to_phys
> on their addresses to break.)  Therefore, you only gain even more
> problems by this method.

A 1M page dedicated to vmemmap would only be used for memmap and only be
addressed using the virtual memory address. The pfn to page and vice versa
mapping that is the basic mechamism for virt_to_page and friends is then
straightforward. Nothing breaks.

memory-model.h:
#elif defined(CONFIG_SPARSEMEM_VMEMMAP)

/* memmap is virtually contiguous.  */
#define __pfn_to_page(pfn)      (vmemmap + (pfn))
#define __page_to_pfn(page)     (unsigned long)((page) - vmemmap)


However, if you have such a sparse address space you would not want 1M
blocks for memmap but rather 4k pages. So yes you would need to use
vmalloc space (or reserve another virtual range for that purpose).

--
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>

  reply	other threads:[~2010-07-29 22:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 15:46 Minchan Kim
2010-07-26 16:40 ` Christoph Lameter
2010-07-26 22:47   ` Minchan Kim
     [not found]   ` <pfn.valid.v4.reply.1@mdm.bga.com>
     [not found]     ` <AANLkTimtTVvorrR9pDVTyPKj0HbYOYY3aR7B-QWGhTei@mail.gmail.com>
2010-07-27  8:12       ` Milton Miller
2010-07-27  8:13         ` KAMEZAWA Hiroyuki
2010-07-27 10:01           ` Minchan Kim
2010-07-27 14:34             ` Christoph Lameter
2010-07-27 22:33               ` Minchan Kim
2010-07-28 15:14                 ` Christoph Lameter
2010-07-28 15:56                   ` Minchan Kim
2010-07-28 17:02                     ` Christoph Lameter
2010-07-28 22:57                       ` Minchan Kim
2010-07-29 15:46                         ` Christoph Lameter
2010-07-29 16:18                           ` Minchan Kim
2010-07-29 16:47                             ` Christoph Lameter
2010-07-29 17:03                               ` Minchan Kim
2010-07-29 17:30                                 ` Christoph Lameter
2010-07-29 18:33                                   ` Russell King - ARM Linux
2010-07-29 19:55                                     ` Christoph Lameter
2010-07-29 21:13                                       ` Russell King - ARM Linux
2010-07-29 20:55                                     ` Dave Hansen
2010-07-29 22:14                                       ` Russell King - ARM Linux
2010-07-29 22:28                                         ` Christoph Lameter [this message]
2010-07-30  0:38                                         ` Dave Hansen
2010-07-30  9:43                                           ` Minchan Kim
2010-07-30 12:48                                           ` Christoph Lameter
2010-07-30 15:43                                             ` Dave Hansen
2010-07-31 15:30                                             ` Russell King - ARM Linux
2010-08-02 15:48                                               ` Christoph Lameter
2010-07-30  9:32                                       ` Minchan Kim
2010-07-31 10:38                                         ` Russell King - ARM Linux
2010-08-11 15:31                                           ` Dave Hansen
2010-07-27  9:56         ` Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1007291723310.21024@router.home \
    --to=cl@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mel@csn.ul.ie \
    --cc=miltonm@bga.com \
    --cc=minchan.kim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox