From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A2F5C46467 for ; Wed, 11 Jan 2023 16:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234417AbjAKQWQ (ORCPT ); Wed, 11 Jan 2023 11:22:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235478AbjAKQVq (ORCPT ); Wed, 11 Jan 2023 11:21:46 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD343395DC; Wed, 11 Jan 2023 08:19:11 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3F6B44DEB; Wed, 11 Jan 2023 16:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1673453950; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9Uo1F/S6/BtgInuYAgaI0yUjIL9CeDbM27HnRNyBOC8=; b=oUm4vmx/tY5jshUMzmTMV4ujxm9WBPq7G63760MdNaeUeWGw61qJWUsBiU/ThcpJxf3YbT 9dnFhOb83o/uIlG01AUWYKBRHbBej41yxRsJGPGrJM6vF20xCc+ljCnJ/Ur+izcnctbDnB +W6AaANj1nk+G3E8ZdNbT5nkdMWH1UE= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1EC6B1358A; Wed, 11 Jan 2023 16:19:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id aLOxBX7hvmPZTgAAMHmgww (envelope-from ); Wed, 11 Jan 2023 16:19:10 +0000 Date: Wed, 11 Jan 2023 17:19:09 +0100 From: Michal Hocko To: Mike Rapoport Cc: Jonathan Corbet , Andrew Morton , Bagas Sanjaya , David Hildenbrand , Johannes Weiner , Lorenzo Stoakes , "Matthew Wilcox (Oracle)" , Mel Gorman , Vlastimil Babka , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 2/2] docs/mm: Physical Memory: add structure, introduction and nodes description Message-ID: References: <20230110152358.2641910-1-rppt@kernel.org> <20230110152358.2641910-3-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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