linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Matthew Wilcox <willy@infradead.org>, John Hubbard <jhubbard@nvidia.com>
Cc: <davem@davemloft.net>, <kuba@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@openeuler.org>, <akpm@linux-foundation.org>,
	<hawk@kernel.org>, <ilias.apalodimas@linaro.org>,
	<peterz@infradead.org>, <yuzhao@google.com>, <will@kernel.org>,
	<jgg@ziepe.ca>, <mcroce@microsoft.com>, <willemb@google.com>,
	<cong.wang@bytedance.com>, <pabeni@redhat.com>,
	<haokexin@gmail.com>, <nogikh@google.com>, <elver@google.com>,
	<memxor@gmail.com>, <vvs@virtuozzo.com>, <linux-mm@kvack.org>,
	<edumazet@google.com>, <alexander.duyck@gmail.com>,
	<dsahern@gmail.com>
Subject: Re: [PATCH net-next -v5 3/4] mm: introduce __get_page() and __put_page()
Date: Mon, 11 Oct 2021 14:37:09 +0800	[thread overview]
Message-ID: <6a072675-89e9-5635-5a9f-08aaf2e5364f@huawei.com> (raw)
In-Reply-To: <YWH4YbkC+XtpXTux@casper.infradead.org>

On 2021/10/10 4:15, Matthew Wilcox wrote:
> On Sat, Oct 09, 2021 at 12:49:29PM -0700, John Hubbard wrote:
>> On 10/9/21 02:37, Yunsheng Lin wrote:
>>> Introduce __get_page() and __put_page() to operate on the
>>> base page or head of a compound page for the cases when a
>>> page is known to be a base page or head of a compound page.
>>
>> Hi,
>>
>> I wonder if you are aware of a much larger, 137-patch seriesto do that:
>> folio/pageset [1]?
>>
>> The naming you are proposing here does not really improve clarity. There
>> is nothing about __get_page() that makes it clear that it's meant only
>> for head/base pages, while get_page() tail pages as well. And the
>> well-known and widely used get_page() and put_page() get their meaning
>> shifted.
>>
>> This area is hard to get right, and that's why there have been 15
>> versions, and a lot of contention associated with [1]. If you have an
>> alternate approach, I think it would be better in its own separate
>> series, with a cover letter that, at a minimum, explains how it compares
>> to folios/pagesets.

As I was not familiar enough with mm, so I tried the semantic of
__page_frag_cache_drain(), which expects a base page or the head
page of a compound page too.

I suppose we may need to put a BUG_ON() to catch the case of
user passing a tail page accidentally, which is a run time error
and has run time overhead?
And adding a new type like folio will allow the compiler to
catch the error without any overhead?

> 
> I wasn't initially sure whether network pagepools should be part of
> struct folio or should be their own separate type.  At this point, I

Actually only a few driver are using page pool now, and others are mostly
using page allocator directly, see page_frag_alloc_align() and
skb_page_frag_refill(), only changing the page pool does not seems helpful
here, maybe the whole network stack should be using a new type like folio,
as the netstask does not need to deal with tail page directly? And it seems
virt_to_page() is one of the things need handling when netstack is changed
to use a new type like folio?

> 


  reply	other threads:[~2021-10-11  6:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-09  9:37 [PATCH net-next -v5 0/4] some optimization for page pool Yunsheng Lin
2021-10-09  9:37 ` [PATCH net-next -v5 1/4] page_pool: disable dma mapping support for 32-bit arch with 64-bit DMA Yunsheng Lin
2021-10-09  9:37 ` [PATCH net-next -v5 2/4] page_pool: change BIAS_MAX to support incrementing Yunsheng Lin
2021-10-09  9:37 ` [PATCH net-next -v5 3/4] mm: introduce __get_page() and __put_page() Yunsheng Lin
2021-10-09 19:49   ` John Hubbard
2021-10-09 20:15     ` Matthew Wilcox
2021-10-11  6:37       ` Yunsheng Lin [this message]
2021-10-11 12:25     ` Jesper Dangaard Brouer
2021-10-11 12:29       ` Ilias Apalodimas
2021-10-12  7:38         ` Yunsheng Lin
2021-10-12  7:49           ` Ilias Apalodimas
2021-10-09  9:37 ` [PATCH net-next -v5 4/4] skbuff: keep track of pp page when pp_frag_count is used Yunsheng Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a072675-89e9-5635-5a9f-08aaf2e5364f@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.duyck@gmail.com \
    --cc=cong.wang@bytedance.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=elver@google.com \
    --cc=haokexin@gmail.com \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxarm@openeuler.org \
    --cc=mcroce@microsoft.com \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nogikh@google.com \
    --cc=pabeni@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vvs@virtuozzo.com \
    --cc=will@kernel.org \
    --cc=willemb@google.com \
    --cc=willy@infradead.org \
    --cc=yuzhao@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox