From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 616CC4218A3 for ; Tue, 16 Jun 2026 09:49:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781603393; cv=none; b=E5dZbxewCyRUZRCPsKhcaiSEVKqmFHEvaYOaOkST3zmZQsMc+bqJdTydfBt8nUP8lLy31tmPuCL3y6a6Dhr533v8/ORXeovqFDifIYMTJA5Ph7DqfKIMjC9zLNNHJCrDUiDJixkeeTTaY6DiRhfro1Jm/eUNO9HViz6cuOZT3GY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781603393; c=relaxed/simple; bh=bq7Ey/g5jcw2smPVT5VTFXIzIBbs+fq+iJnFbJ0fkuU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OX/f/iyfFD3neq4PPulN2rCNr0mUnbFhOwMOQfVlYCzxsewvSpfWglmCNLBrkOY5Xci4FK32Y/0FT+k5mvW5aZPwxgYfXAEZW/jD0CC3NW5L4HYLkoFlCf3bxnWbhfE18YSvEttirM+cM0gLAJ0IblfiZ+W0xiOOBEifcGY/+1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ds4dDEHU; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ds4dDEHU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781603391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bq7Ey/g5jcw2smPVT5VTFXIzIBbs+fq+iJnFbJ0fkuU=; b=Ds4dDEHUqS3NlqZ3bdHXMJrCf2jNyKn5ogJCPn5URgS4r9CDqbpfpfnHwH1+xa0j4zELnK 68x4Z2FHPGjR22TZHdJDv0mj8JThx2mBoOOQ8ukroatwHqrqVNhmMtzxMV0j0rbimf1zHM l2+v6IB4JeJUy2FTAb7w9xGwKdPNWDg= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-jB7_gEICNEO15u8OiGxSgQ-1; Tue, 16 Jun 2026 05:49:47 -0400 X-MC-Unique: jB7_gEICNEO15u8OiGxSgQ-1 X-Mimecast-MFC-AGG-ID: jB7_gEICNEO15u8OiGxSgQ_1781603386 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 059411956069; Tue, 16 Jun 2026 09:49:46 +0000 (UTC) Received: from fedora (unknown [10.44.32.13]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 52DEF3008DC3; Tue, 16 Jun 2026 09:49:42 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 16 Jun 2026 11:49:45 +0200 (CEST) Date: Tue, 16 Jun 2026 11:49:40 +0200 From: Oleg Nesterov To: Breno Leitao Cc: Catalin Marinas , Andrew Morton , lance.yang@linux.dev, Davidlohr Bueso , Qian Cai , 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> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On 06/15, 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: Oleg Nesterov