From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F88C30E84D for ; Mon, 15 Jun 2026 18:27:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781548025; cv=none; b=Ustim9oVmg+QcsuYnuy7/U/qJ08sZqWr1gbdFjavZCKBqNFSn5Yzs3GEGPSkfTlSOQtzms6ypdxaKif7DB4VPiy5joL40rhYsggMPPtkn0iV1fIFSwYQrJo0xQIFxz4mmkjvazFTNcjRlUqBv8i4MNG0Iq+j6wkh8Yde5igSPyw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781548025; c=relaxed/simple; bh=y7jHCWK0XB2v8CEtm3RY9bA+TQxv8cUNEwcqj5ZlukE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MKR7dm011mHlx6ITvf6lTSKDz4IvhUJgUerTfrVbLPmFTglfGvDXgZfbfSwtBdj+ZOeiUbeirudwt/0NuOmB4XV9JHCb0kcINGsVjZcr+PUdriRwkwJ9spUCJt3+ZrYNeWBPyetimLqhk9HT4MiPCfEhZDnL26ZyvNFPlyRMIG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=ecSmxl3Q; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="ecSmxl3Q" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7EF871764; Mon, 15 Jun 2026 11:26:57 -0700 (PDT) Received: from arm.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F08B93F905; Mon, 15 Jun 2026 11:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1781548022; bh=y7jHCWK0XB2v8CEtm3RY9bA+TQxv8cUNEwcqj5ZlukE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ecSmxl3QNOn7wPZyZZDA8+sRpyKKz79XHJMPdyHz8sWZya2Td6+VEafm0tbqyUi2X 4bPFxqKUQF/gKrsKbh1Y60xqMjKC9ie7ZDbD1rEvmdMqs1I3rEb55bS6a8HadYuT5i LyrxKIsGVq2oOQPkrbiLe6RqwpyouLgW2YlwkH+c= Date: Mon, 15 Jun 2026 19:26:58 +0100 From: Catalin Marinas To: Breno Leitao Cc: Andrew Morton , lance.yang@linux.dev, Davidlohr Bueso , Oleg Nesterov , sj@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH v3 2/3] mm/kmemleak: stop the task stack scan early when interrupted Message-ID: References: <20260615-kmemleak-stack-resched-v3-0-acecd7d7fd92@debian.org> <20260615-kmemleak-stack-resched-v3-2-acecd7d7fd92@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260615-kmemleak-stack-resched-v3-2-acecd7d7fd92@debian.org> On Mon, Jun 15, 2026 at 10:49:07AM -0700, Breno Leitao wrote: > scan_block() already checks scan_should_stop() for every pointer and > bails out of the current block, but the task stack walk cannot tell and > keeps issuing a separate scan_should_stop() between every task. > > Return that status from scan_block() and use it as the task stack loop > condition, so the walk stops as soon as a scan is interrupted. > > Suggested-by: Catalin Marinas > Signed-off-by: Breno Leitao Reviewed-by: Catalin Marinas