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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D56CC282C4 for ; Thu, 7 Feb 2019 15:20:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D899E2175B for ; Thu, 7 Feb 2019 15:20:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PzhRlRiD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727129AbfBGPUl (ORCPT ); Thu, 7 Feb 2019 10:20:41 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38626 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfBGPUl (ORCPT ); Thu, 7 Feb 2019 10:20:41 -0500 Received: by mail-wr1-f67.google.com with SMTP id v13so241634wrw.5 for ; Thu, 07 Feb 2019 07:20:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Fc9DvEkHcUwCuUOY+cpjz1+btZOTY1PROVPScsLLvpw=; b=PzhRlRiDHbKDSY4TEyF4EPGZkw2nxzdq9QrAVani2UiOmLUBH0GQWp7CqZ574ALC3/ VHW3tzhqO/X/NS4u3jv5ESlkPOXjMwt4nafPO7y0Wvi+2nUX01aa8GzGp2nkA8G4mTNL sSRs8KMDI5zSgUHyapsCfIU2clxhCsONPeLPriJbew7rwPwfuRDkvG2w6wm1pdBcew3m Sqb7TmIw+xCKrKUmFBEnVyXVM0yr/zJMj1qpWC/n+zBxZckMCkCij49g2JBOec/h90UF DMKPbz7VMdkvH4Yq7kZGRQZ8wBkv0xVtrmBiHHGj7UWi283qR96wChWpKLrSCqvxCkRz iG9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Fc9DvEkHcUwCuUOY+cpjz1+btZOTY1PROVPScsLLvpw=; b=WcdRQ/5FeidwXXEuODBe3C+Wehh0vf/1C3h4pPZDCxDwgSvZPFYubPTaP3mY+31CHP FzUOZ5keKI8Mi7bMdfPj8gXkqQ1p2B8zBQVStbgIfACQcYuV+eVVff768U96GCPB1+XC WYXZ2wwny2LPJUIobTET3b0PAPqW1XzciEhIzf/4gOuEgjNnJQUOKIGejfRy58aazPR5 41fP7H1wom+sOLzdF1lA/lErFseUHxeoU0WJUpGLlgyOAacz5Ho/E+fDWwMwS4PQszAY 2yxogmjn3fmFHmSpIcL3zMw4BC1pXU4LlKtB/dI6Wug8KOjX0+epPUJBYDULle8bgZeO bZGQ== X-Gm-Message-State: AHQUAuapwj2LkBNGVq/NquvJIjljwlUSrt5Vd5ofPV12u4u9OFxVnsUo GFCbGl4Tl9FwAcus58BNp61NEZYqC4Q= X-Google-Smtp-Source: AHgI3IagW/z4YKwVwgn5Kh0Lg5P5qgSV7tXprEIYUoqCLnxXOCYV1fRFYUB/JpVjkIZAG9mrz/12xg== X-Received: by 2002:adf:c5cc:: with SMTP id v12mr12299552wrg.176.1549552839294; Thu, 07 Feb 2019 07:20:39 -0800 (PST) Received: from apalos (ppp-94-65-225-153.home.otenet.gr. [94.65.225.153]) by smtp.gmail.com with ESMTPSA id q21sm14133082wmc.14.2019.02.07.07.20.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 07:20:38 -0800 (PST) Date: Thu, 7 Feb 2019 17:20:34 +0200 From: Ilias Apalodimas To: Matthew Wilcox Cc: brouer@redhat.com, tariqt@mellanox.com, toke@redhat.com, davem@davemloft.net, netdev@vger.kernel.org, mgorman@techsingularity.net, linux-mm@kvack.org Subject: Re: [RFC, PATCH] net: page_pool: Don't use page->private to store dma_addr_t Message-ID: <20190207152034.GA3295@apalos> References: <1549550196-25581-1-git-send-email-ilias.apalodimas@linaro.org> <20190207150745.GW21860@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190207150745.GW21860@bombadil.infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Matthew, On Thu, Feb 07, 2019 at 07:07:45AM -0800, Matthew Wilcox wrote: > On Thu, Feb 07, 2019 at 04:36:36PM +0200, Ilias Apalodimas wrote: > > +/* Until we can update struct-page, have a shadow struct-page, that > > + * include our use-case > > + * Used to store retrieve dma addresses from network drivers. > > + * Never access this directly, use helper functions provided > > + * page_pool_get_dma_addr() > > + */ > > Huh? Why not simply: > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 2c471a2c43fa..2495a93ad90c 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -28,6 +28,10 @@ struct address_space; > struct mem_cgroup; > struct hmm; > > +struct page_pool { > + dma_addr_t dma_addr; > +}; > + > /* > * Each physical page in the system has a struct page associated with > * it to keep track of whatever it is we are using the page for at the > @@ -77,6 +81,7 @@ struct page { > * avoid collision and false-positive PageTail(). > */ > union { > + struct page_pool pool; > struct { /* Page cache and anonymous pages */ > /** > * @lru: Pageout list, eg. active_list protected by > Well updating struct page is the final goal, hence the comment. I am mostly looking for opinions here since we are trying to store dma addresses which are irrelevant to pages. Having dma_addr_t definitions in mm-related headers is a bit controversial isn't it ? If we can add that, then yes the code would look better Thanks /Ilias