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 4478E78F39 for ; Sun, 26 Jan 2025 19:04:31 +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=1737918273; cv=none; b=TCxPZVZPJ1XnXourNPespjMrVbLIwTRqUlxRbfd4cnNZBUJisWaK2CJXc1tNcHf5LFz63K6xdd6SApDfI/AdtHrNHk2v3+wvvuPPXhnvN6ttIKMIXUwo5/Vjv3+eud3bgpY6nU/6xMUOFzJM9w0E9KY/p4vI77JM75d8RyqLroY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737918273; c=relaxed/simple; bh=OfhMQmVi9ajYGPKooiZu8+geF/qzt4wIbExr6JiovJM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iP/kzPghpY8G9RKTcuXCTzMCabgcB/qzyrNIf/dPazWsFLC54x5j7zXcJe7bLA49IhyetvKIsOQk8itam8uHnXjz+mbjFyRvZsQyw/ptrJiZWm+2d3GfI80t9yxowyNv0Y6Q2N7xceG7J/6mzm5Xy1MhCkSy6bPkGK/Gh5MI/Y8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=BTrJJPNC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="BTrJJPNC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737918271; 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=i8PmMpCHGx/VMuaEGT9fo4QjZu/A1gjnBy7YlRwJ3qA=; b=BTrJJPNCoeLbPp+nh9AQk91D7LgJNbhcndA4hkrMqTI480IVfOhIIMkldmW/3huDzlavC7 8F6pUhOvmqpcGga8azXmuoMr/3Ucpk9ZtJGvdfmbunQ+SDMoj01dhk7lR9OiuDYlTb0n3e 8saA+U6Wu84y8CdUt90R44apW0soZ+w= Received: from mx-prod-mc-03.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-135-1UkySfpKO_ewyKqbCBZoUg-1; Sun, 26 Jan 2025 14:04:27 -0500 X-MC-Unique: 1UkySfpKO_ewyKqbCBZoUg-1 X-Mimecast-MFC-AGG-ID: 1UkySfpKO_ewyKqbCBZoUg Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5D9E219560BB; Sun, 26 Jan 2025 19:04:26 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.72]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 2769D195608E; Sun, 26 Jan 2025 19:04:22 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 26 Jan 2025 20:04:00 +0100 (CET) Date: Sun, 26 Jan 2025 20:03:56 +0100 From: Oleg Nesterov To: Linus Torvalds Cc: Paolo Bonzini , "Michael S. Tsirkin" , Christian Brauner , "Eric W. Biederman" , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [GIT PULL] KVM changes for Linux 6.14 Message-ID: <20250126190356.GC28135@redhat.com> References: <20250124163741.101568-1-pbonzini@redhat.com> <20250126142034.GA28135@redhat.com> <20250126185354.GB28135@redhat.com> 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: <20250126185354.GB28135@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 01/26, Oleg Nesterov wrote: > > On 01/26, Linus Torvalds wrote: > > > > I was literally thinking that instead of a "hidden" flag, it would be > > a "self-hidden" flag. > > > > So if somebody _else_ (notably the sysadmin) does "ps" they see the > > kernel thread as a subthread. > > > > But when you look at your own /proc/self/task/ listing, you only see > > your own explicit threads. So that "is_singlethreaded()" logic works. > > Got it... > > I don't think we even need to detect the /proc/self/ or /proc/self-thread/ > case, next_tid() can just check same_thread_group, > > - if (!(pos->flags & PF_HIDDEN)) { > + if (!(pos->flags & PF_HIDDEN) || !same_thread_group(current, pos))) { > > right ? Or we can exclude them from /proc/whatever/task/ listing unconditionally, and change next_tgid() to report them as if there are not sub-threads, iow "ps ax" will show all the PF_HIDDEN tasks... I dunno. Oleg.