linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* get_page_map in 2.2 vs 2.4
@ 2000-06-30 17:38 Timur Tabi
  2000-07-03 13:59 ` Stephen C. Tweedie
  0 siblings, 1 reply; 2+ messages in thread
From: Timur Tabi @ 2000-06-30 17:38 UTC (permalink / raw)
  To: Linux MM mailing list

In 2.2, the function get_page_map is this:

/* 
 * Given a physical address, is there a useful struct page pointing to it?
 */

static struct page * get_page_map(unsigned long page)
{
	struct page *map;
	
	if (MAP_NR(page) >= max_mapnr)
		return 0;
	if (page == ZERO_PAGE(page))
		return 0;
	map = mem_map + MAP_NR(page);
	if (PageReserved(map))
		return 0;
	return map;
}

In 2.4, it's been changed to this:

/* 
 * Given a physical address, is there a useful struct page pointing to
 * it?  This may become more complex in the future if we start dealing
 * with IO-aperture pages in kiobufs.
 */

static inline struct page * get_page_map(struct page *page)
{
	if (page > (mem_map + max_mapnr))
		return 0;
	return page;
}

It appears that although the comment is no longer correct.  In 2.2, the
function took an unsigned long and returned a pointer to a mem_map_t.  In 2.4,
it takes a mem_map_t and returns it.  This is hardly useful.

Am I missing something?  What was wrong with the original implementation?  And
why hasn't the comment changed?




--
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please don't cc: me, because then I'll just get two copies of the same message.
--
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.eu.org/Linux-MM/

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

* Re: get_page_map in 2.2 vs 2.4
  2000-06-30 17:38 get_page_map in 2.2 vs 2.4 Timur Tabi
@ 2000-07-03 13:59 ` Stephen C. Tweedie
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen C. Tweedie @ 2000-07-03 13:59 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Linux MM mailing list

Hi,

On Fri, Jun 30, 2000 at 12:38:19PM -0500, Timur Tabi wrote:
> 
> In 2.4, it's been changed to this:
> 
> /* 
>  * Given a physical address, is there a useful struct page pointing to
>  * it?  This may become more complex in the future if we start dealing
>  * with IO-aperture pages in kiobufs.
>  */
> 
> static inline struct page * get_page_map(struct page *page)
> {
> 	if (page > (mem_map + max_mapnr))
> 		return 0;
> 	return page;
> }

Yes.  get_page_map() takes a "struct page *" which has been obtained
through some magic pointer arithmetic; we still have to do the bounds
checking to make sure that the resulting pointer pointed to a valid
part of the mem_map array.  The comment about IO aperture memory still
stands, as in the future we may want to support the creation of
additional mem_map arrays at run time to map struct page *'s beyond
the end of physical memory, to allow kiobuf I/O on things like
framebuffers.

> Am I missing something?  What was wrong with the original implementation?

It didn't work on IA32 systems with >=1GB memory.

Cheers,
 Stephen
--
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.eu.org/Linux-MM/

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

end of thread, other threads:[~2000-07-03 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-30 17:38 get_page_map in 2.2 vs 2.4 Timur Tabi
2000-07-03 13:59 ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox