Re: Can we remove the Zone_DMA?

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

 



2010/4/4 Joerg Roedel <joro@xxxxxxxxxx>:
> On Sun, Apr 04, 2010 at 12:21:54PM +0800, tek-life wrote:
>> I’m a newbie on the linux kernel. Now I am reading the source code of
>> Linux . I have a question in the following about ZONE_DMA.
>>
>>
>> In Linux , The Memory is divided to three zone. They are ZONE_DMA
>> 、ZONE_NORMAL  and ZONE_HIGHMEM. From the book of "Undstand the Linux
>> kernel ", the ZONE_DMA has the effect that the Direct Memory Access
>> (DMA) processors for old ISA buses have a strong limitation: they are
>> able to address only the first 16 MB of RAM. SO ,we must set a zone
>> for  the DMA on ISA bus.  And I suspect that the hardware has
>> developed so quickly .And  in this days the ISA has been weeded out.
>> And so ,if we not defined the ZONE_DMA, is the system be effected? And
>> why not remove ZONE_DMA from the kernel . If it cann‘t to do so,the
>> compatibility is the only reason?
>
> There are a couple of reasons to keep ZONE_DMA. It is not used by ISA
> device drivers exclusivly. Old style PCI devices may have small DMA
> masks (so they could address between 16 MB and 4GB depending on the
> device) too. Drivers for these devices often use ZONE_DMA as a fallback
> if they can't allocate memory addressable by the device using
> ZONE_NORMAL. So there is a use for ZONE_DMA with 32bit PCI too.
> (And I also remember I have seen an AM2 board with an ISA slot for
>  embedded purposes too, so ISA is not completly dead)
>
>        Joerg

I think Joerg is right. In short wods, ZONE_DMA is not only an
relative thing to ISA devices. ISA devices need it in the ancient
board because they could not refer to all the memory addresses which
are usually 32-bit, on the contrary, ISA devices just use 24-bit
address. ZONE_DMA serves those kmalloc call with GFP_DMA and __GFP_DMA
flags, and that is the true meaning of it.

It is not reasonable to truncate ZONE_DMA, because although it could
be defined as a size of 16MB, the actual size of DMA transferring
region is decided by the watermark of ZONE_NORMAL. It is saying that a
part of ZONE_DMA could be used as ZONE_NORMAL memory when
lowmem_reserved_ratio is set to a certain value. Refer to
Documentation/sysctl/vm.txt for more information.

Best regards,
-- 
Adam Jiang
-----------------------------------
e-mail:jiang.adam@xxxxxxxxx
http://www.adamjiang.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