lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y77hfY8+FUun1tKa@dhcp22.suse.cz>
Date:   Wed, 11 Jan 2023 17:19:09 +0100
From:   Michal Hocko <mhocko@...e.com>
To:     Mike Rapoport <rppt@...nel.org>
Cc:     Jonathan Corbet <corbet@....net>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Bagas Sanjaya <bagasdotme@...il.com>,
        David Hildenbrand <david@...hat.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Lorenzo Stoakes <lstoakes@...il.com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [PATCH v2 2/2] docs/mm: Physical Memory: add structure,
 introduction and nodes description

On Wed 11-01-23 18:02:03, Mike Rapoport wrote:
> On Wed, Jan 11, 2023 at 02:36:16PM +0100, Michal Hocko wrote:
> > On Wed 11-01-23 14:24:43, Mike Rapoport wrote:
> > > On Tue, Jan 10, 2023 at 05:54:10PM +0100, Michal Hocko wrote:
> > > > On Tue 10-01-23 17:23:58, Mike Rapoport wrote:
> > > > [...]
> > > > > +* ``ZONE_DMA`` and ``ZONE_DMA32`` represent memory suitable for DMA by
> > > > > +  peripheral devices that cannot access all of the addressable memory.
> > > > 
> > > > I think it would be better to not keep the historical DMA based menaning
> > > > and teach that future developers. You can say something like
> > > > 
> > > > ZONE_DMA and ZONE_DMA32 have historically been used for memory suitable
> > > > for DMA. For many years there are better more robust interfaces to
> > > > get memory with DMA specific requirements (Documentation/core-api/dma-api.rst).
> > > 
> > > But even today ZONE_DMA(32) means that the memory is suitable for DMA. This
> > > is nicely encapsulated with dma APIs and there should be no new GFP_DMA
> > > users, but still memory outside ZONE_DMA is not suitable for DMA.
> > 
> > Well, the thing is that ZONE_DMA means different thing for different
> > architectures. For x86 it is effectivelly about ISA attached HW - which
> > means almost nothing these days. There is plethora of other HW with
> > different address range constrains for DMA transfer so binding the zone
> > with DMA is more likely to cause confusion than it helps.
> 
> Ok, how about
> 
> * ``ZONE_DMA`` and ``ZONE_DMA32`` historically represented memory suitable for
>   DMA by peripheral devices that cannot access all of the addressable
>   memory. For many years there are better more and robust interfaces to get
>   memory with DMA specific requirements (:ref:`DMA API <_dma_api>`), but
>   ``ZONE_DMA`` and ``ZONE_DMA32`` still represent memory ranges that have
>   restrictions on how they can be accessed.
>   Depending on the architecture, either of these zone types or even they both
>   can be disabled at build time using ``CONFIG_ZONE_DMA`` and
>   ``CONFIG_ZONE_DMA32`` configuration options. Some 64-bit platforms may need
>   both zones as they support peripherals with different DMA addressing
>   limitations.

Sounds better to me. Thanks!
At least ZONE_DMA32 is somehow better defined as it represents 32b
address range constrain. DMA can be really different on different
arches. Probably good to have it here. Ideally we would have a reference
how that range is established but architectures are not unified in that
respect.


-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ