All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Siemon <dan@coverfire.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: "Björn Töpel" <bjorn@kernel.org>, Xdp <xdp-newbies@vger.kernel.org>
Subject: Re: Umem Questions
Date: Fri, 21 May 2021 14:17:31 -0400	[thread overview]
Message-ID: <28b9bb250f204022d3400a447ad6b9f04922dec2.camel@coverfire.com> (raw)
In-Reply-To: <CAJ8uoz1Q-a8wS0nb=iCBjrgqzNT0ww8sPbT1tgF0kbBxEhG2sw@mail.gmail.com>

> 
> Could you please check if this one fixes it for you?
> 
> diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
> index 56a28a686988..f01ef6bda390 100644
> --- a/net/xdp/xdp_umem.c
> +++ b/net/xdp/xdp_umem.c
> @@ -27,7 +27,7 @@ static void xdp_umem_unpin_pages(struct xdp_umem
> *umem)
>  {
>         unpin_user_pages_dirty_lock(umem->pgs, umem->npgs, true);
> 
> -       kfree(umem->pgs);
> +       kvfree(umem->pgs);
>         umem->pgs = NULL;
>  }
> 
> @@ -99,8 +99,7 @@ static int xdp_umem_pin_pages(struct xdp_umem
> *umem,
> unsigned long address)
>         long npgs;
>         int err;
> 
> -       umem->pgs = kcalloc(umem->npgs, sizeof(*umem->pgs),
> -                           GFP_KERNEL | __GFP_NOWARN);
> +       umem->pgs = kvcalloc(umem->npgs, sizeof(*umem->pgs),
> GFP_KERNEL | __GFP_NOWARN);
>         if (!umem->pgs)
>                 return -ENOMEM;
> 
> @@ -123,7 +122,7 @@ static int xdp_umem_pin_pages(struct xdp_umem
> *umem, unsigned long address)
>  out_pin:
>         xdp_umem_unpin_pages(umem);
>  out_pgs:
> -       kfree(umem->pgs);
> +       kvfree(umem->pgs);
>         umem->pgs = NULL;
>         return err;
>  }

Hi Magnus,

Thanks for looking at this. Yes, this patch allows me to create a much
larger Umem. I tried up to 32 GB.

I have not yet run any tests that extensively use the larger Umem.

Thanks again.


      reply	other threads:[~2021-05-21 18:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 14:34 Umem Questions Dan Siemon
2021-05-17  8:21 ` Magnus Karlsson
2021-05-19 21:09   ` Dan Siemon
2021-05-20  6:14     ` Magnus Karlsson
2021-05-20 12:40       ` Magnus Karlsson
2021-05-20 12:50         ` Magnus Karlsson
2021-05-21 18:17           ` Dan Siemon [this message]

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=28b9bb250f204022d3400a447ad6b9f04922dec2.camel@coverfire.com \
    --to=dan@coverfire.com \
    --cc=bjorn@kernel.org \
    --cc=magnus.karlsson@gmail.com \
    --cc=xdp-newbies@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.