From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f43.google.com (mail-yx1-f43.google.com [74.125.224.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBAB1270557 for ; Tue, 2 Dec 2025 22:35:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764714956; cv=none; b=LjGF7AuStl3iVSO8jukU9dzPrvGVdRfHIAfLlLkXGJUJo5aquY+alhSKcSlarNiHmaIdrihctvVUkbcIcqxRjEcNslDDgiYduCD4YLV4bW+iP+gi9fbxh4fXq2TPAlG0BfHroNMPPWUIf8qj7TadR6bmKf4eIfErnmuio+1Tsxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764714956; c=relaxed/simple; bh=c3mR6BZuY4hFSjct5BypWPJ9sGu6XgpedPKKtBghZxE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cVAGg2QNrfRspCytAbxq9inK6L5zE8X45Lox7GBjV/M+8EoMVykQvckNjLwiZNRaWW7VZngKf57KB8uzwnCtEx/8rwAX8W5tvqUhSyDT8/d7plK4ZlK0tNICdTfxykSBMMurW5Xe6XabSSbxLZX7kQGgrMf6+MOHCWiYAc89NWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OI4yO3Ah; arc=none smtp.client-ip=74.125.224.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OI4yO3Ah" Received: by mail-yx1-f43.google.com with SMTP id 956f58d0204a3-640f2c9cc72so5573792d50.3 for ; Tue, 02 Dec 2025 14:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764714954; x=1765319754; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ylVM1ZycKfOUhBo0Kx2tN3N0OsyBVhTCMjf7buZNaFc=; b=OI4yO3AhmyVxghNkFizjVzQBNIY46wJYyY1teyjvpBjDIsAzqtHIlTzo0patci59bj 7rDyfHrte1GjbXUm/3Yyc7sbqDQlUfod6tnD4iHNf83sNRqOHAkLA+8t30du4C0jcaaS c/MJFtA/WhfmCtITNbphFknSTUA5cDQd/lIt+IUB0b4uHWtn/VwhvY39M+tl9tgD48jJ UZobYKCYkzOIng2AWsr6YtoA2aSuFbWvQqg4y3i4MbrnuWluaytaXNjnFosuGkp/8zN9 Tp+VpstjmwJH+dv1NqWl1TZPsQ3BIxN6cYk88QRRbIsFm69/US5kVyKpieGC09ywVq0N h4vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764714954; x=1765319754; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ylVM1ZycKfOUhBo0Kx2tN3N0OsyBVhTCMjf7buZNaFc=; b=O2eoRT4Wka2zpUZrmItoPgKXO+8WPjub/I9the4QSqgVIUCm2sWhs++dP1+u3c0Q2a VulvNmlzVclE9/GTjFoJNmMZfh6NM7Hl/BbIZQEX0U05iqJO72QyFORlEumElEi0BRq5 FEaBr2HB8Zu5L5KzNoexpWBsjSh5vU56N9hEkku+3FbnfDtEnz/TR+BmaytkXXyY2ylW 1ESdWK50N/pmxRjCwXue5JRMGR9652FdMs8xrSG2MV9u1CC+cFdJXdZFdYQ79tfXNslD KsE5Od3sHuH6mg6hkfZ8U/jGsI6hpSE3LY/9z+J3PGsRe78jS9Ey+cW03dF/3XcSInD3 07gQ== X-Forwarded-Encrypted: i=1; AJvYcCXQIFpU0tVTHDdjyvva0lDfyh0p1A0WrJWTi5X8ezK6oiAW0YlQtkdeOZumT65T+qKVOBcAlDqgi5rFyHQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyIL4ScWjmdtyByrQPexyUHnDKMsFs6ANFSUe+EzLxSNTIBVje0 3QAZqH22IQcVtqrg8PywZe/p0oz+8WMwPf8d6Aeewn0DipSlLAiiyfYz X-Gm-Gg: ASbGncu0oSe+R4mVkVCgDf3dXXY0VYuqh2AdWMy6/+8QiNSQ/RkZD/dCW8IAIINxUXe W2F2+FxSaxO/vTpktxRGpTHDwbJbkU7T5beR/0OEBdgUZRDSwohIfvn55U1KFTPmW3YoVewAxwu k01FAH2006BU1NWhhtnR09QrDavTMoGeBerA4iGfuFGkhBKmG4ptmXDiBMzb4ZKMAJpBhHA6Azg 87CjHSL+cLxG34D+9WA7g6ojRfeIW69MBVVAI8D7DljNgi+qKxDLr9vS5YaY2sHU+pSnGcQyzX4 LNJ9bOOuaVXKA4WPCG+QLMyu4YbsxsxTDceaMf0i/39dRKVfSfXvtbbutRM6WKqAr5IffQXTjK6 2rSy6zZY8KRh5eKL+0NMihm3C8zjkVDLY7F2iVZuHO9BLyfUIIpSkm/k2U8lyaGBI6wlUh1Q2ho fnv40tDLScHpFp3Q0u++feH2ZmZhaxR929SanxXbHV/+fd1UijvG28uQ9J X-Google-Smtp-Source: AGHT+IEWLac7ShLnOCEKilr1QZDB3R81AMdSAdYpR3XnPeC/KGg5zW4Lsd43s3UjQ6DQjFnauKwvkA== X-Received: by 2002:a05:690c:2784:b0:78a:722f:a7c9 with SMTP id 00721157ae682-78c0c1e75c2mr3231817b3.47.1764714953844; Tue, 02 Dec 2025 14:35:53 -0800 (PST) Received: from devvm11784.nha0.facebook.com ([2a03:2880:25ff:2::]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78ad102d25csm67836137b3.44.2025.12.02.14.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 14:35:52 -0800 (PST) Date: Tue, 2 Dec 2025 14:35:51 -0800 From: Bobby Eshleman To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mina Almasry , Stanislav Fomichev , asml.silence@gmail.com, Bobby Eshleman Subject: Re: [PATCH net-next v2] net: devmem: convert binding refcount to percpu_ref Message-ID: References: <20251202-upstream-percpu-ref-v2-1-4accb717da40@meta.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: <20251202-upstream-percpu-ref-v2-1-4accb717da40@meta.com> On Tue, Dec 02, 2025 at 11:34:17AM -0800, Bobby Eshleman wrote: > From: Bobby Eshleman > > Convert net_devmem_dmabuf_binding refcount from refcount_t to percpu_ref > to optimize common-case reference counting on the hot path. > > The typical devmem workflow involves binding a dmabuf to a queue > (acquiring the initial reference on binding->ref), followed by > high-volume traffic where every skb fragment acquires a reference. > Eventually traffic stops and the unbind operation releases the initial > reference. Additionally, the high traffic hot path is often multi-core. > This access pattern is ideal for percpu_ref as the first and last > reference during bind/unbind normally book-ends activity in the hot > path. > > __net_devmem_dmabuf_binding_free becomes the percpu_ref callback invoked > when the last reference is dropped. > My apologies for sending this out after net-next closed. Won't happen again. Best, Bobby