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 7F90D45948 for ; Tue, 16 Dec 2025 09:44:41 +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=1765878282; cv=none; b=Utak/yhM9ctrnTy5Mkp2r298eFKDi98vfoXqxdyppIDBaITcZ4XfFSrAVhMlVz+FCOxlTIv+JYwzLczEvzRAg4Lqqy20pKVHqveWpyrlY4Auc7EsYbhjVYJA54W+6TX7lT4AbiDlRIYmsl58Z7a/RqbZzZkwcHEiUOJFpbJjUs8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765878282; c=relaxed/simple; bh=AvYlv9tIZvxZIF7Y8eInTd+O90cnrwabVCSYyqjFRLc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GiZ6PluOgSrmHSnjp4GYQ9e7K2/9zFp9d4RLR4KCDcm9e2wRuPAhCdKp+xEiIuOsSqdXkoBbUbIx8FyxZieqCG3Pzk+tfLphlRz0/j1gL6t+L0HKeoG2emJDZN3aqSxEWdOz5uBQV9b/N0+ukoqAz72m+B1eQTsaYC92nlkw8v0= 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=Et/2TNau; 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="Et/2TNau" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765878280; 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=AvYlv9tIZvxZIF7Y8eInTd+O90cnrwabVCSYyqjFRLc=; b=Et/2TNau62zU1LdPSiLev0a++lnuu7XhTsilocetQ0tkczXwPUTZ2g3XiN5IdCOi5UVjey H/oxhZMJQBWlDaVBMFUf2EA5hutF2KsppTQPs9T7x+MvCUQI+WWiCJf0xrMAG6XbVtGwNm rd1ouMTWYTeoWq6cnfLbVK4gA7WeGno= 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-497-1Y2t3UmTOGO62alS9dvU0w-1; Tue, 16 Dec 2025 04:44:37 -0500 X-MC-Unique: 1Y2t3UmTOGO62alS9dvU0w-1 X-Mimecast-MFC-AGG-ID: 1Y2t3UmTOGO62alS9dvU0w_1765878276 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 431C21956050; Tue, 16 Dec 2025 09:44:36 +0000 (UTC) Received: from fedora (unknown [10.45.225.177]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 640A21800367; Tue, 16 Dec 2025 09:44:34 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 16 Dec 2025 10:44:35 +0100 (CET) Date: Tue, 16 Dec 2025 10:44:32 +0100 From: Oleg Nesterov To: Tycho Andersen , Mateusz Guzik Cc: Christian Brauner , linux-kernel@vger.kernel.org Subject: Re: [PATCH] pid: remove unnecessary idr_preload() Message-ID: References: <20251215201514.1343231-1-tycho@kernel.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: <20251215201514.1343231-1-tycho@kernel.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On 12/15, Tycho Andersen wrote: > > From: "Tycho Andersen (AMD)" > > As near as I can tell, nothing in the second pidmap_lock critical section > actually allocates an id, so there is no need to do idr_preload(). > idr_replace() does not, nor does pidfs_add_pid(). Yes. The extra idr_preload() was needed for pidfs_add_pid() after the commit 9698d5a483654 ("pidfs: rework inode number allocation"). But please see [PATCH v3 2/2] pid: only take pidmap_lock once on alloc https://lore.kernel.org/all/20251206131955.780557-3-mjguzik@gmail.com/ This patch removes the unnecessary idr_preload() too. Oleg.