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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 F319CC169C4 for ; Mon, 11 Feb 2019 17:14:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1F9821B1A for ; Mon, 11 Feb 2019 17:14:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lo0nOekM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730572AbfBKROS (ORCPT ); Mon, 11 Feb 2019 12:14:18 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:35184 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbfBKROS (ORCPT ); Mon, 11 Feb 2019 12:14:18 -0500 Received: by mail-pl1-f196.google.com with SMTP id p8so5607250plo.2 for ; Mon, 11 Feb 2019 09:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9zX2LaIivP5IrW+2g3nFwEyNT3JVgCgrnDq2ie5w/4I=; b=lo0nOekMsye6WJPkEcUUVJXMoX2EEOet4cU+M+Gqj6dUQoN1FVPd+LuZ0mFOBOwm1r v22OzjdcNmLnTyT3Gx6yP75cb/P5IF9/WiEeTI9p6YA1RL3UwzqubY01c1NjWIb4YmwN xSrbS6m8GbLDQEyW5XRjjjfVuHODudsxiFixSk+ntcd8jLQwrQkHfOUmeNZSip48i8Zp /ouUna2My7GleBMk9iUbDUbEc/Ub5/+yywgpz4c6dMmS2fe7QaT9kyjwhvSJ188//jBI a59lTZhj2eMRppGQVaLG+HQQQ2irUc1M1qifII6wEfms3q/A4LDJt5+kTgu5GPg4CIGL 3nPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9zX2LaIivP5IrW+2g3nFwEyNT3JVgCgrnDq2ie5w/4I=; b=cZOHHl4ijEqXKR4oCGGUpZxcwZLBCy2vfyheUmwte8GElbMloZExfrFQVnVJ37BhrX hdHwGSy+Z0lrJjF57yJQlkF1jypgH4acipk/tCZWihJWqvyYVFH7CWSLDnwuEUh9A+2S 7iKnu8hiT5U38pxlwN66Xw9F2pGemBOha6xUIiq6G4UQ77oRb+euzdO/6QdFGmoiO17S aqevlvwjrUWo813ZPvbTBtGr1dB9gPBp4akn1XldqYjLAE1EMo7bdpoum4irtzVb3aeo UJYX2JeWfCHnNhyie0NLwQlY/5V0H/L9QojHwWDUo7ZSa8W9pKLfP2UV4/y15/Ry2Udr 6KDQ== X-Gm-Message-State: AHQUAuafTJzcN5J4wUm27U3xD9sGSsbNCjU7WVe0fKPBaq33WINZANsX AbqM+ge9k9pnMbMYu+aNYCM= X-Google-Smtp-Source: AHgI3IbsIoghZPcXS+Ij5y7KSRU3ijsBImHFQk33e0rlJql/8jsaFdJVfSLKuNdSowa6666+PFaHuQ== X-Received: by 2002:a17:902:7c82:: with SMTP id y2mr37959914pll.33.1549905257696; Mon, 11 Feb 2019 09:14:17 -0800 (PST) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id l87sm19868977pfj.35.2019.02.11.09.14.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 09:14:16 -0800 (PST) Subject: Re: [RFC, PATCH] net: page_pool: Don't use page->private to store dma_addr_t To: Tariq Toukan , Ilias Apalodimas , Matthew Wilcox Cc: David Miller , "brouer@redhat.com" , "toke@redhat.com" , "netdev@vger.kernel.org" , "mgorman@techsingularity.net" , "linux-mm@kvack.org" References: <1549550196-25581-1-git-send-email-ilias.apalodimas@linaro.org> <20190207150745.GW21860@bombadil.infradead.org> <20190207152034.GA3295@apalos> <20190207.132519.1698007650891404763.davem@davemloft.net> <20190207213400.GA21860@bombadil.infradead.org> <20190207214237.GA10676@Iliass-MBP.lan> From: Eric Dumazet Message-ID: <64f7af75-e6df-7abc-c4ce-82e6ca51fafe@gmail.com> Date: Mon, 11 Feb 2019 09:14:15 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 02/11/2019 12:53 AM, Tariq Toukan wrote: > > Hi, > > It's great to use the struct page to store its dma mapping, but I am > worried about extensibility. > page_pool is evolving, and it would need several more per-page fields. > One of them would be pageref_bias, a planned optimization to reduce the > number of the costly atomic pageref operations (and replace existing > code in several drivers). > But the point about pageref_bias is to place it in a different cache line than "struct page" The major cost is having a cache line bouncing between producer and consumer. pageref_bias means the producer only have to read the "struct page" and not dirty it in the case the page can be recycled. > I would replace this dma field with a pointer to an extensible struct, > that would contain the dma mapping (and other stuff in the near future). > This pointer fits perfectly with the existing unsigned long private; > they can share the memory, for both 32- and 64-bits systems. > > The only downside is one more pointer de-reference. This should be perf > tested. > However, when introducing the page refcnt bias optimization into > page_pool, I believe the perf gain would be guaranteed. Only in some cases perhaps (when the cache line can be dirtied without performance hit)