Re: offset problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi..

On Mon, Sep 20, 2010 at 19:30, mohit verma <mohit89mlnc@xxxxxxxxx> wrote:
> thanks guys,
>  but the problem is :
>  what is  the need of page aligned address? as we have given starting
> address 5000 and the length 1000 ( in the example by prabhu) so it should
> start from that location.

I think it is due to two reasons:

1. on some architecture, non page aligned access could mean
trap/exception. Well, x86 is immune in this case...but if you wanna
make your code safely portable, I think it's a must.

2. By making it page aligned, at least you reduce fragmentation.

How come? Let's assume you just have 8K address space. You allocate a
memory starting at 3K as large as 4K. That means you occupy 3K up to
7K address. What's left? 0-1 K and 7-8 K, right?

And what if you wanna allocate another 4K? Yes, a page can fit
that...but not mapping. We can't split below page granularity, so at
least we need two page. one is mapped to 0-1 K, the other is for 7-8K.
It's 2 page vs 3 page case.

Yes, there's slab...but if we can allocate straight in page size
granularity, things would be simpler, right?

-- 
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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux