From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Rientjes <rientjes@google.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Willem de Bruijn <willemb@google.com>,
Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] net, skbuff: do not prefer skb allocation fails early
Date: Thu, 3 Jan 2019 02:29:28 -0800 [thread overview]
Message-ID: <948700b2-993b-e17f-67df-e8517e87998d@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1901021300420.62853@chino.kir.corp.google.com>
On 01/02/2019 01:01 PM, David Rientjes wrote:
> Commit dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by
> __GFP_RETRY_MAYFAIL with more useful semantic") replaced __GFP_REPEAT in
> alloc_skb_with_frags() with __GFP_RETRY_MAYFAIL when the allocation may
> directly reclaim.
>
> The previous behavior would require reclaim up to 1 << order pages for
> skb aligned header_len of order > PAGE_ALLOC_COSTLY_ORDER before failing,
> otherwise the allocations in alloc_skb() would loop in the page allocator
> looking for memory. __GFP_RETRY_MAYFAIL makes both allocations failable
> under memory pressure, including for the HEAD allocation.
>
> This can cause, among many other things, write() to fail with ENOTCONN
> during RPC when under memory pressure.
>
> These allocations should succeed as they did previous to dcda9b04713c
> even if it requires calling the oom killer and additional looping in the
> page allocator to find memory. There is no way to specify the previous
> behavior of __GFP_REPEAT, but it's unlikely to be necessary since the
> previous behavior only guaranteed that 1 << order pages would be reclaimed
> before failing for order > PAGE_ALLOC_COSTLY_ORDER. That reclaim is not
> guaranteed to be contiguous memory, so repeating for such large orders is
> usually not beneficial.
>
> Removing the setting of __GFP_RETRY_MAYFAIL to restore the previous
> behavior, specifically not allowing alloc_skb() to fail for small orders
> and oom kill if necessary rather than allowing RPCs to fail.
>
> Fixes: dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by
> __GFP_RETRY_MAYFAIL with more useful semantic")
> Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Thanks David.
next prev parent reply other threads:[~2019-01-03 10:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 21:01 [patch] net, skbuff: do not prefer skb allocation fails early David Rientjes
2019-01-03 10:29 ` Eric Dumazet [this message]
2019-01-04 20:54 ` 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=948700b2-993b-e17f-67df-e8517e87998d@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=netdev@vger.kernel.org \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
--cc=willemb@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;
as well as URLs for NNTP newsgroup(s).