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.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 2CABDC282C2 for ; Thu, 7 Feb 2019 15:07:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB70F2190A for ; Thu, 7 Feb 2019 15:07:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="qYRV/s33" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726576AbfBGPHt (ORCPT ); Thu, 7 Feb 2019 10:07:49 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:55522 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfBGPHt (ORCPT ); Thu, 7 Feb 2019 10:07:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RvhgZZiNjrchkt8tGLRKuRoiHHJ2J8lC3cqTBJJMPdA=; b=qYRV/s33SwufxYIcTEcE1h2kd ymD3bMGIUxOVs94/eickTZ49U4nzaFa/BvA4nfGcrw26HRqvf7CrI2Ayrd64n0M7UTN1cNYZSz6B7 iNgPD5fFRwAf3WsEgkBrL7WPsnDCa/R787rcZ6BxyF6okHZJLXWWcHK7X9o35yUev/lFXOmJKpUUM /C532myfmxX4mzicUD3t4r8VI5uH2oJ6U2YUPEkeBuDu/gezrAeLD6MD3vsazUEI9o0fSsC0vqb/1 wk3Mg5p1+wf/ZASgQ/Ekw8oZxvKrIo+BFprAQ2XYgQWIOT+cDKZ6ThBscrGsBWW3R2rUqbLJmVhOU LnBL7BO0A==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1grlHF-0001NI-6e; Thu, 07 Feb 2019 15:07:45 +0000 Date: Thu, 7 Feb 2019 07:07:45 -0800 From: Matthew Wilcox To: Ilias Apalodimas 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: <20190207150745.GW21860@bombadil.infradead.org> References: <1549550196-25581-1-git-send-email-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1549550196-25581-1-git-send-email-ilias.apalodimas@linaro.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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