[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKhg4tJP1dNZfeMPZLv6n_ocuQq-4xM3a5uRMGqcnHrfkoozDg@mail.gmail.com>
Date: Thu, 14 Dec 2023 11:42:58 +0800
From: Liang Chen <liangchen.linux@...il.com>
To: Ilias Apalodimas <ilias.apalodimas@...aro.org>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, hawk@...nel.org, linyunsheng@...wei.com,
netdev@...r.kernel.org, linux-mm@...ck.org, jasowang@...hat.com,
almasrymina@...gle.com
Subject: Re: [PATCH net-next v9 2/4] page_pool: halve BIAS_MAX for multiple
user references of a fragment
On Wed, Dec 13, 2023 at 7:39 PM Ilias Apalodimas
<ilias.apalodimas@...aro.org> wrote:
>
> Hi Liang,
>
> On Tue, 12 Dec 2023 at 06:47, Liang Chen <liangchen.linux@...il.com> wrote:
> >
> > Referring to patch [1], in order to support multiple users referencing the
> > same fragment and prevent overflow from pp_ref_count growing, the initial
> > value of pp_ref_count is halved, leaving room for pp_ref_count to increment
> > before the page is drained.
> >
> > [1]
> > https://lore.kernel.org/all/20211009093724.10539-3-linyunsheng@huawei.com/
>
> We only need this if patch #4 is merged. In that case, I'd like to
> describe the changelog a bit better.
> Something along the lines of
> "Up to now, we were only subtracting from the number of used page
> fragments to figure out when a page could be freed or recycled. A
> following patch introduces support for multiple users referencing the
> same fragment. So reduce the initial page fragments value to half to
> avoid overflowing"
>
Sure. Thanks for the suggestion!
> Thanks
> /Ilias
> > same fragment
>
>
>
> >
> > Signed-off-by: Liang Chen <liangchen.linux@...il.com>
> > Reviewed-by: Yunsheng Lin <linyunsheng@...wei.com>
> > ---
> > net/core/page_pool.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> > index 106220b1f89c..436f7ffea7b4 100644
> > --- a/net/core/page_pool.c
> > +++ b/net/core/page_pool.c
> > @@ -26,7 +26,7 @@
> > #define DEFER_TIME (msecs_to_jiffies(1000))
> > #define DEFER_WARN_INTERVAL (60 * HZ)
> >
> > -#define BIAS_MAX LONG_MAX
> > +#define BIAS_MAX (LONG_MAX >> 1)
> >
> > #ifdef CONFIG_PAGE_POOL_STATS
> > /* alloc_stat_inc is intended to be used in softirq context */
> > --
> > 2.31.1
> >
Powered by blists - more mailing lists