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 151D12C2374 for ; Tue, 16 Dec 2025 09:40:04 +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=1765878006; cv=none; b=GJ/QZt9vPROBXsA/yPi1c0u6X/99slne9csVVw2/x7VgLKF5wRHcqlNEOxh0+ri6npbtheuLq/4dhh7yTc0wINrOyK1wptvTOpsd0yNAATwU7fxxGnypTCzaojoxvQLWdOC/+0fEG5mCpacCBlwOBB/JT2x1+myfT0cIRe26D/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765878006; 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=uDzXyz4mOqxvszuHvgJynrLeKZurg2BCVYrtjAwpS/S+pYb0vuBAvy75zpYo77nF0kdbHmTssAxEo68OJsg+rlZ5VaR3LTg6Bvr3aZteUGn828I3Zq5SltoOfGCpHOV9L2pzNi5lR9RkB6X/S2IgjydFv4L5kqlJxF5uQhuN+dE= 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=gF+6von0; 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="gF+6von0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765878004; 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=gF+6von0oI5AJCp316EaLlYAWbchWJtDCzeu/pbohiK1fgErFfLqYn1nIk9WS/yyQmP8UF Zgb0jL0YW+ecMsArGm0tGlHwlv97mjWmeUAxQxAHu4vOsBwGFB4YRNTknCcxBaWMgEDQUQ 1BM2u5m9n46OkeQ02YuGWAdxl+E2brg= Received: from mx-prod-mc-08.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-173-krsreqyTOpSL3RTlUiRibA-1; Tue, 16 Dec 2025 04:40:02 -0500 X-MC-Unique: krsreqyTOpSL3RTlUiRibA-1 X-Mimecast-MFC-AGG-ID: krsreqyTOpSL3RTlUiRibA_1765878001 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 50CB718002F9; Tue, 16 Dec 2025 09:40:01 +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 C3E241800367; Tue, 16 Dec 2025 09:39:59 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 16 Dec 2025 10:40:00 +0100 (CET) Date: Tue, 16 Dec 2025 10:39:58 +0100 From: Oleg Nesterov To: Tycho Andersen 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.