mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Andi Kleen <ak@suse.de>, "Dave S. Miller" <davem@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: tcp_do_sendmsg() allocation still broken ?
Date: Sun, 29 Oct 2000 02:16:42 +0100	[thread overview]
Message-ID: <20001029021642.A16126@gruyere.muc.suse.de> (raw)
In-Reply-To: <20001029020311.A16003@gruyere.muc.suse.de> <Pine.LNX.4.21.0010282108150.1319-100000@freak.distro.conectiva>
In-Reply-To: <Pine.LNX.4.21.0010282108150.1319-100000@freak.distro.conectiva>; from marcelo@conectiva.com.br on Sat, Oct 28, 2000 at 09:13:27PM -0200

On Sat, Oct 28, 2000 at 09:13:27PM -0200, Marcelo Tosatti wrote:
> 
> 
> On Sun, 29 Oct 2000, Andi Kleen wrote:
> 
> > On Sat, Oct 28, 2000 at 07:12:44PM -0200, Marcelo Tosatti wrote:
> > > 
> > > David,
> > > 
> > > tcp_do_sendmsg() still allocates using GFP_KERNEL when it can't, it seems: 
> > 
> > tcp_do_sendmsg() should only be called from process context, because it can
> > sleep for other reasons anyways. 
> > 
> > If someone calls it from interrupt context it needs to be fixed.
> 
> Andi,
> 
> Think about nbd. 

Making tcp_do_sendmsg use GFP_ATOMIC would make it too unreliable for other
situations. Penalizing the whole system just for nbd is not a good idea.

> 
> It allocates memory inside its request function, and since we do write
> throttling in try_to_free_pages() we can end up with this deadlock in low 
> memory conditions:
> 
> nbd_do_request -> nbd_send_req -> nbd_xmit -> sock_sendmsg -> ... ->
> tcp_do_sendmsg -> tcp_send_skb -> skb_copy -> alloc_skb ->
> kmalloc(GFP_KERNEL) -> kmem_cache_grow -> get_free_pages ->
> try_to_free_pages -> shrink_mmap -> try_to_free_buffers ->
> sync_page_buffers -> ll_rw_block -> make_request -> add_request ->
> nbd_do_request -> nbd_send_req -> ...
> 
> until there are no more free requests on the request queue and writer
> processes stuck on __get_request_wait.

Looks like a job for PF_MEMALLOC and making GFP_KERNEL fail earlier.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-10-29  1:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-28 21:12 Marcelo Tosatti
2000-10-29  1:03 ` Andi Kleen
2000-10-28 23:13   ` Marcelo Tosatti
2000-10-29  1:16     ` Andi Kleen [this message]
2000-10-28 23:25       ` Marcelo Tosatti
2000-10-29 11:36       ` Alan Cox
2000-10-29  1:34     ` David S. Miller
2000-10-29  1:46   ` Rik van Riel
2000-10-29  7:15     ` Andi Kleen
2000-10-29  1:34 ` David S. 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=20001029021642.A16126@gruyere.muc.suse.de \
    --to=ak@suse.de \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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

all inboxes | Powered by JetHome®