Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 1997 17:25:59 -0600 (CST)
From:      jpt@msc.edu (Joseph Thomas)
To:        hackers@freebsd.org
Subject:   Assumptions about kmem_malloc()...
Message-ID:  <199702272326.RAA01886@ww.msc.edu>

next in thread | raw e-mail | index | archive | help

	We are working on an ATM device driver and have the requirment
of needing to allocate somewhat large memory chunks (more then one
page in length) which are used for DMA. We've discovered the hard
way (okay - maybe I should looked better) that adjacent virtual pages
are not necessarily adjacent physically.

Questions:

	o When using kmem_malloc(), do virtual and physical boundaries
always align to a page start?

		Real experience seems to say that new allocs always
	align to a virtual and physical page boundaries but I may
	just be "getting lucky".

	o Other then contigmalloc(), is there a way to malloc contiguous
physical memory greater then one page?

		The driver waits to malloc memory until microcode is
	downloaded to the NIC (Fore PCA200E). Since the download is
	user initiated, and because we'd like to move toward loadable
	modules, the prospect of having large amounts of contiguous
	memory is greatly dimished by the time we ask for it.

	o What other hidden gotchas are there in working with DMA and
device drivers?

		Except for when I was asking for more then one page
	of memory (that is, I reduce structure sizes to be small
	enough to fit in one page) everything seems to be working
	great. However, there's a vast wealth of experience out there
	which I'd like to tap if I've missed something more suttle...


Thanks.

-- 
Joseph Thomas                           E/Mail:  jpt@msc.edu
Minnesota Supercomputer Center, Inc.    	 jpt@magic.net
1200 Washington Ave So.			Tel:	 +1 612 337 3558
Minneapolis, MN     55415-1227          FAX:     +1 612 337 3400

	An elephant is a mouse with an operating system.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702272326.RAA01886>