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 87AA535E1BF for ; Tue, 16 Jun 2026 09:48:39 +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=1781603320; cv=none; b=eSezaQLtwutkbWMnpYQDq3VjSFGuxlZMbcOb/rK0PgJpy7rg7UmLykIxVmr2eJqSM8/itrRWSaV/loDzG/8FccLNdVLF68kborsZkLvU4YlGOX0TdfEet8DA0+kxuCOkeT3xEXEFeuObfQtnqpaCpwwNtLsZoGdkCCLN4tC/1Nw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781603320; c=relaxed/simple; bh=iG49210mPJRB346YjOoXvwu+ax2F6sy5x/U7luKa+dU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o/WiJmQ7ZdbjlMARxWJ3wH17Ues33t7jPQX5FrgA0qFCNZhncx7s+b0utH4FuNfgFJTupNK7XtnYbug/8qGtDEGi6p4E/Sv6igJEoNMQMhVplzYPlYqnsswYribE6HbzZR58VkdIiEWVM9yNd9CCI1ZWZy71T7ztTaJNO2jeMNM= 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=XqPVOtFg; 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="XqPVOtFg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781603318; 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=iG49210mPJRB346YjOoXvwu+ax2F6sy5x/U7luKa+dU=; b=XqPVOtFgnK5FbUWgRyjcmSLrSvIEHtcjSk0GSI4nbazHR8HiQq7Q9vt3Je4+bpv9fGNbmG AAvtPlBs7VevlbsXbNKKz7AzJUawKjyfBnzQsNkPVFjlQcYDkmvlHR2TcbvhBZGTAK1N/x 8piPx11HAIlJiHeKZ6p9+XuuVKepj8s= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-3JPyiv44NBySqQcyDJU7qQ-1; Tue, 16 Jun 2026 05:48:33 -0400 X-MC-Unique: 3JPyiv44NBySqQcyDJU7qQ-1 X-Mimecast-MFC-AGG-ID: 3JPyiv44NBySqQcyDJU7qQ_1781603311 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E043180065E; Tue, 16 Jun 2026 09:48:31 +0000 (UTC) Received: from fedora (unknown [10.44.32.13]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 100FF180028B; Tue, 16 Jun 2026 09:48:26 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 16 Jun 2026 11:48:30 +0200 (CEST) Date: Tue, 16 Jun 2026 11:48:25 +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, stable@vger.kernel.org Subject: Re: [PATCH v3 1/3] mm/kmemleak: avoid soft lockup when scanning task stacks Message-ID: References: <20260615-kmemleak-stack-resched-v3-0-acecd7d7fd92@debian.org> <20260615-kmemleak-stack-resched-v3-1-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-1-acecd7d7fd92@debian.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 06/15, Breno Leitao wrote: > > Walk the tasks one PID at a time with find_ge_pid(), taking the RCU read > lock only to look up and pin each task. The stack is then scanned with no > lock held, so cond_resched() runs between tasks and the scan stops early > on scan_should_stop(). This follows the next_tgid()/task_seq_get_next() > iteration pattern and keeps each RCU critical section short. Reviewed-by: Oleg Nesterov