From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6F85B13AFD for ; Tue, 15 Aug 2023 18:28:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77F4BC433C8; Tue, 15 Aug 2023 18:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692124137; bh=/qruM4K34GEGf+StPBYxRoP0CWoc0pHOT9PCxjD218c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OkWhtJDu7Is84Ym19H+u7zVakV0q6ehat1w8njTrbVRyuNIBSGUKya1FsZKQ2/3eW DCMU89Q5QfAXBmYOgL9v3lr5TIwMqLnG2VP6pt8CK1cbEp5uSEHRqclEBczftWsLyi /BsBBVdWN1g7Evw3haiLSPPXDRuBAlBcpnw8bM+kQFpQwpkQ/SV+zy1cQGHpG6sOqb 4x7vKW0Q5ks7AriJBw3TXWEnENJyMLsXNM7EJHp6uBee46HUdEmkOqS3ak1P2TaxAl KAOeuT3+D2I6zWH5b8nCogW6hTDDU1SzzSEIyGkV3wJ+pmFrPiSFqCT0Udm15rDwGj XYnTmjxADj/XA== Date: Tue, 15 Aug 2023 11:28:56 -0700 From: Jakub Kicinski To: Vadim Fedorenko Cc: Jiri Pirko , Arkadiusz Kubalewski , Jonathan Lemon , Paolo Abeni , Milena Olech , Michal Michalik , linux-arm-kernel@lists.infradead.org, poros@redhat.com, mschmidt@redhat.com, netdev@vger.kernel.org, linux-clk@vger.kernel.org, Bart Van Assche , intel-wired-lan@lists.osuosl.org, Jiri Pirko Subject: Re: [PATCH net-next v4 3/9] dpll: core: Add DPLL framework base functions Message-ID: <20230815112856.1f1bd3ac@kernel.org> In-Reply-To: References: <20230811200340.577359-1-vadim.fedorenko@linux.dev> <20230811200340.577359-4-vadim.fedorenko@linux.dev> <20230814201709.655a24e2@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 15 Aug 2023 19:20:31 +0100 Vadim Fedorenko wrote: > >> + ret = xa_alloc(&dpll_device_xa, &dpll->id, dpll, xa_limit_16b, > >> + GFP_KERNEL); > > > > Why only 16b and why not _cyclic? > > I cannot image systems with more than 65k of DPLL devices. We don't > store any id's of last used DPLL device, so there is no easy way to > restart the search from the last point. And it's not a hot path to > optimize it. I think this gets used under the xa_lock() so you can just add a static variable inside the function to remember previous allocation. I don't expect >64k devices either, obviously, but what are we saving by not allowing the full u32 range?