From: Saeed Mahameed <saeedm@dev.mellanox.co.il>
To: Tom Herbert <tom@herbertland.com>
Cc: kernel netdev <netdev@brouer.com>,
Saeed Mahameed <saeedm@mellanox.com>,
netdev <netdev@vger.kernel.org>,
Tariq Toukan <tariqt@mellanox.com>, Davem <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Jesper Dangaard Brouer <brouer@redhat.com>
Subject: Re: [PATCH net] net/mlx5e: Do not recycle pages from emergency reserve
Date: Tue, 24 Jan 2017 11:29:24 +0200 [thread overview]
Message-ID: <CALzJLG_YLH01C-rd4eXCP2r1VGX8_Oy35cYivTzeQCuDK1rGJg@mail.gmail.com> (raw)
In-Reply-To: <CALx6S37EsGgf69R6N5DkLQbOgiHO1J4si4LMJ1+DMjnHW41eMQ@mail.gmail.com>
On Sun, Jan 22, 2017 at 7:50 PM, Tom Herbert <tom@herbertland.com> wrote:
> On Sat, Jan 21, 2017 at 12:31 PM, Saeed Mahameed
> <saeedm@dev.mellanox.co.il> wrote:
>> On Sat, Jan 21, 2017 at 9:12 PM, kernel netdev <netdev@brouer.com> wrote:
>>>
>>>
>>> Den 21. jan. 2017 7.10 PM skrev "Tom Herbert" <tom@herbertland.com>:
>>>
>>> On Thu, Jan 19, 2017 at 11:14 AM, Saeed Mahameed
>>> <saeedm@dev.mellanox.co.il> wrote:
>>>> On Thu, Jan 19, 2017 at 9:03 AM, Eric Dumazet <eric.dumazet@gmail.com>
>>>> wrote:
>>>>> From: Eric Dumazet <edumazet@google.com>
>>>>>
>>>>> A driver using dev_alloc_page() must not reuse a page allocated from
>>>>> emergency memory reserve.
>>>>>
>>>>> Otherwise all packets using this page will be immediately dropped,
>>>>> unless for very specific sockets having SOCK_MEMALLOC bit set.
>>>>>
>>>>> This issue might be hard to debug, because only a fraction of received
>>>>> packets would be dropped.
>>>>
>>>> Hi Eric,
>>>>
>>>> When you say reuse, you mean point to the same page from several SKBs ?
>>>>
>>>> Because in our page cache implementation we don't reuse pages that
>>>> already passed to the stack,
>>>> we just keep them in the page cache until the ref count drop back to
>>>> one, so we recycle them (i,e they will be re-used only when no one
>>>> else is using them).
>>>>
>>> Saeed,
>>>
>>> Speaking of the mlx page cache can we remove this or a least make it
>>> optional to use. It is another example of complex functionality being
>>> put into drivers that makes things like backports more complicated and
>>
>> Re complexity, I am not sure the mlx page cache is that complex,
>> we just wrap alloc_page/put_page with our own page cache calls.
>> Roughly the page cache implementation is 200-300 LOC tops all concentrated
>> in one place in the code.
>>
> Taken as part of the RX buffer management code the whole thing in very
> complicated and seems to be completely bereft of any comments in the
> code as to how things are supposed to work.
>
The Idea is fairly simple, maybe we could have made it cleaner if we
better decoupled the page
cache from the rx logic.
The page cache works in parallel to the rx logic, it takes its owns ref counts,
this way the rx logic will continue working as if there was no cache
(get/put_pages).
but instead of of the kernel (get/put_pages) it will call the internal
cache get/put_cache_page.
Yeah I agree, some comments could help. We will work on this when we
fix the HOL issues.
next prev parent reply other threads:[~2017-01-24 9:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 7:03 [PATCH net] net/mlx5e: Do not recycle pages from emergency reserve Eric Dumazet
2017-01-19 19:14 ` Saeed Mahameed
2017-01-19 19:25 ` Eric Dumazet
2017-01-19 19:39 ` Saeed Mahameed
2017-01-21 18:09 ` Tom Herbert
[not found] ` <CAPe+=50xs=MMqxHPgTiGa3qytL7633Cygf_vBWuAuq=ceLyacg@mail.gmail.com>
2017-01-21 19:26 ` Eric Dumazet
2017-01-23 9:14 ` Jesper Dangaard Brouer
2017-01-24 9:21 ` Saeed Mahameed
2017-01-21 20:31 ` Saeed Mahameed
2017-01-22 17:50 ` Tom Herbert
2017-01-24 9:29 ` Saeed Mahameed [this message]
2017-01-23 8:39 ` Jesper Dangaard Brouer
2017-01-23 15:45 ` David Miller
2017-01-22 18:09 ` Tom Herbert
2017-01-20 10:28 ` Saeed Mahameed
2017-01-20 17:43 ` David Miller
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=CALzJLG_YLH01C-rd4eXCP2r1VGX8_Oy35cYivTzeQCuDK1rGJg@mail.gmail.com \
--to=saeedm@dev.mellanox.co.il \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@brouer.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=tariqt@mellanox.com \
--cc=tom@herbertland.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;
as well as URLs for NNTP newsgroup(s).