Re: Getting Physical address of a buffer
Re: Getting Physical address of a buffer
- Subject: Re: Getting Physical address of a buffer
- From: James C <email@hidden>
- Date: Sun, 8 Aug 2010 09:42:14 +1200
Hi Terry and Shailesh,
Re (4) below, hypothetically, could that include de-powering only some
parts of physical memory, when they're not needed?
Shailesh, you know that the physical memory isn't contiguous. What
would you think of being given the physical address of the first
0-byte segment? Why would that not meet your needs?
Regards,
James.
> Message: 4
> Date: Fri, 6 Aug 2010 20:43:42 -0700
> From: Terry Lambert <email@hidden>
> Subject: Re: Getting Physical address of a buffer
> To: shailesh jain <email@hidden>
> Cc: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> This question gets asked every once in a while: "why do I have to use OS routines to talk to hardware?".
>
> The basic answer is that there's virtual memory, there's wired memory, and then there's physical memory, and all three aren't the same thing.
>
> There are several reasons that an OS that runs its kernel in a virtual address space doesn't want to give you physical address information directly; let's briefly hit the top four on my personal top ten list:
>
<snip>
> (4) The OS likes to be kept informed of information for its own reasons so it can play tricks behind your back
>
> The tricks themselves don't matter, what matters is that you enable performance and power management winds by following the rules; if you don't follow the rules, and try to avoid the OS interfaces, you also avoid the OS signaling mechanisms that are used to implement these optimization. Unfortunately for you, this is like declaring a variable that is modified out of scope, and not marking it volatile: failure to notify the OS of the nature of your access means the OS gets to do any optimization it wants. For a volatile variable, that may mean not exiting the work loop when the signal handler fires. For a device driver, it generally means a panic in the driver.
>
> -- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden