Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp287010lqo; Wed, 15 May 2024 14:42:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvrvPF0sdARy6fNBdQfuM4X+wYARdS/VlbviUH21YCpsIMYS1b9kYk09pZgmtX32O2+7nrn+mSLp1k7UqV+xKNd3Z6ceoEpGEiNELmlA== X-Google-Smtp-Source: AGHT+IHWh3UoQTHhfShbdgSXDsgDXex7uiWwJc4KfGZShKojaOWHYSha3GhFiIFmJVPw7DIYs935 X-Received: by 2002:a05:6a00:1a8f:b0:6ed:caf6:6e4b with SMTP id d2e1a72fcca58-6f4e02d3473mr18589131b3a.18.1715809357311; Wed, 15 May 2024 14:42:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715809357; cv=pass; d=google.com; s=arc-20160816; b=ERMtfCe2eUdDVC8VTwoPvD8ck2bkf3UlkG+JNiAoXMiRNzLjZ3acB2BBlZIEnBDy+v 4JMdqrT5S7Arg7XHwWJhgPwSMkCgcqpJKmWb+jvnW+OrNaWjbpciMvadirAx76ZtNXrp gCZQKG6vmNCYf8MtQ5ZL+c43wedsqtI4zD391UPkUqqfOO0Uw2SC8cXXRMIww5nEVlft PS7fjKNApvF5OasX1YmFnKhJjwXdA0d6hTnh6Ewx0v5AijCZWFBHLdiKhpQJVR8onUGQ kvhNmHQKmzBKM2SD7yZ3CFsgPn0Wzx1JtVV2f7oqXugNKHD10YUqstME9NGfU+iQQpMg IWIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=tuWaZOrYxVBktYIPE8wQ9/5sOB1xMLG0jqqM5TYjEm8=; fh=aSAx2uCCfH18t2EAoVwZ0lPzSgBGrRHAxQrXm2fn5/c=; b=hreA2no08caCjLHt3elbjSX8gGuf1vcpEbhjANLuJA31yTaLZNbQacpIEhKNEIJHvJ 6eAGRtXJGlysp+a1RyH4LiMoOEhc/InT3azkjwSwhTFFiRA3LHLEGteeHzWhQ2i4ur4X +33vPb9+inSHMAzuYqmTeMJmkjya6W3Hjexr1K3IfnLP62euSS2HcnLzkfWv4yMLnfaN 0qwaOVxE8udluVB6Uch1H6DXvtXS4vM+49nrMQPVuR6+Eil53msmXi68X09PP13Rb1fe TKuKMiQ7BuxbFDx3LsUpiCrysc83xedhrBYZzu3QPh28KZz5bheOA8H1GM5XKDXnllyX wuog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cwvtWq94; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412c3689dsi14167185a12.757.2024.05.15.14.42.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 14:42:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cwvtWq94; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 14265B227D8 for ; Wed, 15 May 2024 21:42:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB17315B54A; Wed, 15 May 2024 21:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cwvtWq94" Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) (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 907801FC4 for ; Wed, 15 May 2024 21:42:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715809346; cv=none; b=Avn5soeAtZm5Hb+NODnvCyUAZMwf0HUsa7IoJybTRHpBEficcNlur5JrL8nPudBTdNZUCUYieCYdnGzY2RATXLuPr2WePIKjvR72KvBlznpZSgTWRHrU2J5YJht0sp9c5EjnMnBi/nXqzq9msUXWv4ZR31UXn4vGNcBj5W8M91I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715809346; c=relaxed/simple; bh=MK0GT5U6TGjZWZCbbcndd1n1OAqP1jMr72KmQoMHoso=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mAePf1iCMLK7yA5lBnnE5ZLjVwLi2VJyHykUd1cgkdkJI3xBPW45DqgLlq0rsCySCc1yAYkrpPCsaFpMo7Ee8CrVzwrdEkQDx2gAElOYK+T7Iw9RbFF7Z0JTwgH8yReg1ggEWgzjo7W/LwD73xrBkPc+0DHDaviLNOseKDq5Nhg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cwvtWq94; arc=none smtp.client-ip=209.85.222.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ua1-f41.google.com with SMTP id a1e0cc1a2514c-7f34ebbcde4so2265390241.3 for ; Wed, 15 May 2024 14:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715809343; x=1716414143; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tuWaZOrYxVBktYIPE8wQ9/5sOB1xMLG0jqqM5TYjEm8=; b=cwvtWq94SwDFYs0pPfsiS7X9ceWF8WkX1cvPc7dzDlAicJ21s8MlihDdaSwE8ty2s/ kPNW44JReIACblv+zXsyUy5GcRwV/haMxFOMgdYs1b+IQcy4YHS/WGAevyGtS168R90K o3BA0JVBqAC+65UdLt/8dxZsg9wskt5CN12f0+7eFAntwYYlJnoyONoM/5+WhRabGErV 3fUoDd5hRX8gEOOTIDPk0qY7dgzWDkUckfzL/QiREed3y65yrMWdrvxaxAorW3bHdz2u xoTSlBxA3MV51LBXK08pB/q23WXZE59d09MhfbV3wJX2LSVi68bERIHtSo1+0wkX6G45 ZHOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715809343; x=1716414143; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tuWaZOrYxVBktYIPE8wQ9/5sOB1xMLG0jqqM5TYjEm8=; b=KEUqIaTXDUpU7wwphDGenOLEoRIHPSFc38fF06BrX2UFK/F/ZwsyyB4x3ifz12coZr LAfZHoIQDNsc4Q0VymOktk36k10XnGYZcjmwB1yH2FbpnaY03zO64Zj7hsqwPnN7SR/W KCY8ZoYo1lv+zPTY8wQg2kPIF5oxkXJ/vfjcoEW38sYTotC5t25zNqfG5bwdQBi5mue4 mP+m9ogZhS2sCfMD65ewBq1PgJdg0B6QFLfvIJJih5LJdIrLNaRGBONuJpNX8rlO2QS+ hmdi0PfSoD39Q5tw2nNkvv9V2vZcUqK4zCobGXvy59Fpm3ljudypkiEa4Cfjv7moFQuV gdhg== X-Forwarded-Encrypted: i=1; AJvYcCXASm6zRrP0PYhoqdSJXW8kscef1JH87wfqVHsB5i2D0mnSpfDMHc7sOb5bSNSdnOITcAsnx+pCFKu2woxzJYhl7iS9rwGpm96/SwDu X-Gm-Message-State: AOJu0YzUmYhVntKCcsTtF1BM3OCFSk7v20j3GAIp2lWnaDEFCJbjA6+J +U72MqZpzhPH97NSfjRHtRL9EK5QFkFvSmWCECsDfg1UJxUwS+mIDZ2TwyxED3XOsf6w9ZcIB/f iO0aeiCH21jNORcgBOrG84/tBjhO8HVC45zo0 X-Received: by 2002:a05:6122:1699:b0:4df:1a28:5e3c with SMTP id 71dfb90a1353d-4df88138a64mr16748298e0c.0.1715809343258; Wed, 15 May 2024 14:42:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240514160926.1309778-1-cmllamas@google.com> In-Reply-To: From: Alice Ryhl Date: Wed, 15 May 2024 23:42:11 +0200 Message-ID: Subject: Re: [PATCH v2] binder: use bitmap for faster descriptor lookup To: Carlos Llamas Cc: Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Suren Baghdasaryan , linux-kernel@vger.kernel.org, kernel-team@android.com, Tim Murray , John Stultz , Steven Moreland , Nick Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024 at 6:43=E2=80=AFPM Carlos Llamas = wrote: > > On Wed, May 15, 2024 at 04:38:51PM +0000, Carlos Llamas wrote: > > On Wed, May 15, 2024 at 05:29:29PM +0200, Alice Ryhl wrote: > > > On Tue, May 14, 2024 at 6:09=E2=80=AFPM Carlos Llamas wrote: > > > > +static inline int > > > > +dbitmap_get_first_zero_bit(struct dbitmap *dmap, unsigned long *bi= t) > > > > +{ > > > > + unsigned long n; > > > > + > > > > + n =3D find_first_zero_bit(dmap->map, dmap->nbits); > > > > + if (unlikely(n =3D=3D dmap->nbits)) > > > > + return -ENOSPC; > > > > + > > > > + *bit =3D n; > > > > + set_bit(n, dmap->map); > > > > + > > > > + return 0; > > > > +} > > > > > > Could we rename this method to something that makes it more clear tha= t > > > it's not just a getter, but that it actually also sets the bit? > > > > > > Alice > > > > Sure, what were you thinking? I had picked "get" and not just "find" to > > indicate this behavior. However, I'll take any better ideas. The option > > of dbitmap_find_and_set_first_zero_bit() seemed too long for me. > > > > -- > > Carlos Llamas > > I like dbitmap_acquire_first_zero_bit(). Sounds better? acquire sounds good! Alice