On Mon, Dec 14, 2009 at 1:06 AM, Joel Fernandes <agnel.j...@gmail.com>wrote:

> Hi Mulyadi,
>
> Thanks for your response. But, DMA doesn't happen to the stack so its
> ok if the (2-page)stack is not physically contiguous as long as it is
> virtually contiguous?
>
> I'm talking in terms of the processor architecture where all memory
> accesses are infact virtual when paging
> is turned on, so should accesses to the stack be?
>
> I think the answer to my question might be kernel memory is directly
> mapped to physical memory (LOW MEM), and so anything contiguous in the
> kernel's virtual address space is also physically contiguous. Yes?
>
> Thanks,
> -Joel
>

Hi Joe/Mulyadi,
The  reason I guess is:
The RAM is (low mem , up to 896 MB) is directly mapped to  kernel virtual
address space, starting from 0xC0000000.  Any RAM (again low mem) physically
contiguous is virtually contiguous too. So when accessing those pages, it
does not require to go through the paging unit. To findout the physical
adddress to operate , it is just a simple math of 'virtual address -
0xc00000000' will give physical address. Similarly we can findout VA, if we
now PA. It will not go through paging unit.  So while serving ISR, it does
not have to go through paging unit etc while accessing the stack and that
might be a reason that kernel stack should be two contiguous physical pages
and in turn virtual pages.
Out of 1 GB kernel virtual address space, RAM is the biggest consumer of
this space.

Thanks,
Gopal.


>
> On Sun, Dec 13, 2009 at 11:52 PM, Mulyadi Santosa
> <mulyadi.sant...@gmail.com> wrote:
> > Sorry, pressing "send" button to send.
> >
> > Imagine if data copied span between those pages, then data on the
> > second page will be left out because DMA operation thinks in physical
> > address while the second page might not be physically adjacent.
> >
> > --
> > regards,
> >
> > Mulyadi Santosa
> > Freelance Linux trainer and consultant
> >
> > blog: the-hydra.blogspot.com
> > training: mulyaditraining.blogspot.com
> >
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecar...@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

Reply via email to