mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	git-commits-head@vger.kernel.org
Subject: Re: [PATCH] kmemleak: Fix scheduling-while-atomic bug
Date: Wed, 01 Jul 2009 10:18:57 +0100	[thread overview]
Message-ID: <1246439937.8492.18.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20090701075332.GA17252@elte.hu>

On Wed, 2009-07-01 at 09:53 +0200, Ingo Molnar wrote:
> * Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:
> 
> > Gitweb:     http://git.kernel.org/linus/acf4968ec9dea49387ca8b3d36dfaa0850bdb2d5
> > Commit:     acf4968ec9dea49387ca8b3d36dfaa0850bdb2d5
> > Parent:     4698c1f2bbe44ce852ef1a6716973c1f5401a4c4
> > Author:     Catalin Marinas <catalin.marinas@arm.com>
> > AuthorDate: Fri Jun 26 17:38:29 2009 +0100
> > Committer:  Catalin Marinas <catalin.marinas@arm.com>
> > CommitDate: Fri Jun 26 17:38:29 2009 +0100
> > 
> >     kmemleak: Slightly change the policy on newly allocated objects
> 
> I think one of the kmemleak fixes that went upstream yesterday 
> caused the following scheduling-while-holding-the-tasklist-lock 
> regression/crash on x86:

Thanks for the patch. The bug was always there, only that the task stack
scanning is now enabled by default (and I probably have a small number
of tasks that the rescheduling didn't happen during stack scanning).

> The minimal fix below removes scan_yield() and adds a cond_resched() 
> to the outmost (safe) place of the scanning thread. This solves the 
> regression.

With CONFIG_PREEMPT disabled it won't reschedule during the bss scanning
but I don't see this as a real issue (task stacks scanning probably
takes longer anyway).

> The background scanning thread could probably also be reniced
> to +10.

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index e766e1d..6006553 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1039,6 +1039,7 @@ static int kmemleak_scan_thread(void *arg)
 	static int first_run = 1;
 
 	pr_info("Automatic memory scanning thread started\n");
+	set_user_nice(current, 10);
 
 	/*
 	 * Wait before the first scan to allow the system to fully initialize.

-- 
Catalin


  parent reply	other threads:[~2009-07-01  9:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200907010300.n6130rRf026194@hera.kernel.org>
2009-07-01  7:53 ` Ingo Molnar
2009-07-01  8:10   ` Pekka Enberg
2009-07-01  9:18   ` Catalin Marinas [this message]
2009-07-01  9:30     ` Ingo Molnar
2009-07-01  9:46       ` Catalin Marinas
2009-07-01 11:04         ` Ingo Molnar
2009-07-02 12:48           ` Exiting with locks still held (was Re: [PATCH] kmemleak: Fix scheduling-while-atomic bug) Catalin Marinas
2009-07-02 12:54             ` Pekka Enberg
2009-07-02 13:06               ` Catalin Marinas
2009-07-02 14:13               ` Catalin Marinas
2009-07-02 17:39                 ` Linus Torvalds
2009-07-03 10:18                   ` Catalin Marinas
2009-07-03  7:04             ` Ingo Molnar
2009-07-02  9:48       ` [PATCH] kmemleak: Fix scheduling-while-atomic bug Catalin Marinas
2009-07-03  7:00         ` [PATCH] kmemleak: Mark nice +10 Ingo Molnar
2009-07-03  8:09           ` Catalin Marinas
2009-07-08 13:33       ` [PATCH] kmemleak: Fix scheduling-while-atomic bug Catalin Marinas
2009-08-23  2:48         ` Ming Lei
2009-08-23 14:59           ` Catalin Marinas
2009-08-24  0:10             ` Ming Lei
2009-08-24 10:02               ` ACPI scheduling while atomic (was: Re: [PATCH] kmemleak: Fix scheduling-while-atomic bug) Catalin Marinas

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=1246439937.8492.18.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=git-commits-head@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®