Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932783AbcJLKs1 (ORCPT ); Wed, 12 Oct 2016 06:48:27 -0400 Received: from foss.arm.com ([217.140.101.70]:57294 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753492AbcJLKsT (ORCPT ); Wed, 12 Oct 2016 06:48:19 -0400 Date: Wed, 12 Oct 2016 11:47:58 +0100 From: Catalin Marinas To: Hillf Danton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "'Andrew Morton'" , "'Andy Lutomirski'" , "'CAI Qian'" Subject: Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning Message-ID: <20161012104758.GB21592@e104818-lin.cambridge.arm.com> References: <1476266223-14325-1-git-send-email-catalin.marinas@arm.com> <00ca01d22471$bcef4ef0$36cdecd0$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00ca01d22471$bcef4ef0$36cdecd0$@alibaba-inc.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 384 Lines: 13 On Wed, Oct 12, 2016 at 06:16:46PM +0800, Hillf Danton wrote: > > @@ -1453,8 +1453,11 @@ static void kmemleak_scan(void) > > > > read_lock(&tasklist_lock); > > do_each_thread(g, p) { > > Take a look at this commit please. > 1da4db0cd5 ("oom_kill: change oom_kill.c to use for_each_thread()") Thanks. Isn't holding tasklist_lock here enough to avoid such races? -- Catalin