From: Linus Torvalds <torvalds@transmeta.com>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Rik van Riel <riel@nl.linux.org>, Bernd Kaindl <bk@suse.de>,
Linux Kernel <linux-kernel@vger.rutgers.edu>,
kernel@suse.de, linux-mm@kvack.org, Alan Cox <alan@redhat.com>
Subject: Re: [patch] fix for OOM deadlock in swap_in (2.2.10) [Re: [test program] for OOM situations ]
Date: Sun, 4 Jul 1999 13:32:10 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.10.9907041329130.1624-100000@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.10.9907042030310.521-100000@laser.random>
On Sun, 4 Jul 1999, Andrea Arcangeli wrote:
>
> Woops, I see your point, now I changed the patch as you suggested to catch
> the ptrace case properly. Now the retval of handle_mm_fault means this:
>
> 1 -> page fault resolved succesfully
> 0 -> we accessed a shared mmap beyond the end of the file.
> So do_page_fault will send a sigbus in this case while
> ptrace won't send the sigbus and will return 0.
> -1 -> OOM. But we don't need to send a sigkill since the lower
> layer just sent out the sigkill for us.
Note that if you handle OOM in the caller instead of in the lower layers,
you get _much_ better behaviour. In particular, the page fault handler
knows whether the fault happened in kernel mode or in user mode, and can
do different things depending on which it was.
See 2.3.10-pre2 - when the OOM fault happens from user mode (the most
common case by far), you can just do a "do_exit(SIGKILL)" and kill it off
much more cleanly without having to go through any extra pseudo-real-time
stuff.
Linus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/
prev parent reply other threads:[~1999-07-04 20:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.10.9907010152410.17156-100000@Wotan.suse.de>
1999-07-03 13:52 ` Andrea Arcangeli
1999-07-04 9:48 ` Rik van Riel
1999-07-04 14:35 ` Andrea Arcangeli
1999-07-04 17:11 ` Linus Torvalds
1999-07-04 17:38 ` Andrea Arcangeli
1999-07-04 17:49 ` Linus Torvalds
1999-07-04 20:15 ` Andrea Arcangeli
1999-07-04 20:32 ` Linus Torvalds [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=Pine.LNX.4.10.9907041329130.1624-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=alan@redhat.com \
--cc=andrea@suse.de \
--cc=bk@suse.de \
--cc=kernel@suse.de \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=riel@nl.linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox