mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + revert-vmalloc-back-off-when-the-current-task-is-killed.patch added to -mm tree
@ 2017-10-04 22:32 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-10-04 22:32 UTC (permalink / raw)
  To: hannes, alan, dvyukov, hch, mhocko, mm-commits


The patch titled
     Subject: Revert "vmalloc: back off when the current task is killed"
has been added to the -mm tree.  Its filename is
     revert-vmalloc-back-off-when-the-current-task-is-killed.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/revert-vmalloc-back-off-when-the-current-task-is-killed.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/revert-vmalloc-back-off-when-the-current-task-is-killed.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Johannes Weiner <hannes@cmpxchg.org>
Subject: Revert "vmalloc: back off when the current task is killed"

This reverts 5d17a73a2ebe ("vmalloc: back off when the current task is
killed") and 171012f56127 ("mm: don't warn when vmalloc() fails due to a
fatal signal").

5d17a73a2ebe ("vmalloc: back off when the current task is killed") made
all vmalloc allocations from a signal-killed task fail.  We have seen
crashes in the tty driver from this, where a killed task exiting tries to
switch back to N_TTY, fails n_tty_open because of the vmalloc failing, and
later crashes when dereferencing tty->disc_data.

Arguably, relying on a vmalloc() call to succeed in order to properly exit
a task is not the most robust way of doing things.  There will be a
follow-up patch to the tty code to fall back to the N_NULL ldisc.

But the justification to make that vmalloc() call fail like this isn't
convincing, either.  The patch mentions an OOM victim exhausting the
memory reserves and thus deadlocking the machine.  But the OOM killer is
only one, improbable source of fatal signals.  It doesn't make sense to
fail allocations preemptively with plenty of memory in most cases.

The patch doesn't mention real-life instances where vmalloc sites would
exhaust memory, which makes it sound more like a theoretical issue to
begin with.  But just in case, the OOM access to memory reserves has been
restricted on the allocator side in cd04ae1e2dc8 ("mm, oom: do not rely on
TIF_MEMDIE for memory reserves access"), which should take care of any
theoretical concerns on that front.

Revert this patch, and the follow-up that suppresses the allocation
warnings when we fail the allocations due to a signal.

Link: http://lkml.kernel.org/r/20171004185906.GB2136@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Alan Cox <alan@llwyncelyn.cymru>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/vmalloc.c |    6 ------
 1 file changed, 6 deletions(-)

diff -puN mm/vmalloc.c~revert-vmalloc-back-off-when-the-current-task-is-killed mm/vmalloc.c
--- a/mm/vmalloc.c~revert-vmalloc-back-off-when-the-current-task-is-killed
+++ a/mm/vmalloc.c
@@ -1695,11 +1695,6 @@ static void *__vmalloc_area_node(struct
 	for (i = 0; i < area->nr_pages; i++) {
 		struct page *page;
 
-		if (fatal_signal_pending(current)) {
-			area->nr_pages = i;
-			goto fail_no_warn;
-		}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-04 22:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 22:32 + revert-vmalloc-back-off-when-the-current-task-is-killed.patch added to -mm tree akpm

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).