From owner-svn-src-all@freebsd.org Thu Nov 21 21:34:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11A221CB828 for ; Thu, 21 Nov 2019 21:34:53 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47JtBM5Wplz3yYR for ; Thu, 21 Nov 2019 21:34:51 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-lj1-f172.google.com with SMTP id y23so4882642ljh.10 for ; Thu, 21 Nov 2019 13:34:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4DOMGgulyKFF9icac0EaFhtPMT+6AucIJGfMsjG4A54=; b=AfQvYx8YcnhXcTUWm8y4fhMreOOwzqBnn2Reo3sgllajbpXTrRXqknN4LX4OqEiem+ iqc1hig+UbGYubZfoUKXfIzNbVpIyGJi4O7RnoSaXbdxaR4AKbCWwIoW07kLmf4G44lf wg5onxKteD+CAONUV0c2D2uDh7E59dv0/5LcppJXWmN5lTJjWrO3lU7ZiayWMjgLZCed X3kJQ5pGniJvbfAEfanpR9oQDnmhf726XEKVeB6zgeDJDxqaqQ5KJplDfkgKleUjPGEZ EWs3JhgInEqbLBWVFHMqX0e2/PHG70LpxDdbjdmzJaAou8F+iTugTlNL3AyyiIkBnjUA hsFw== X-Gm-Message-State: APjAAAWCZ86XlK3Wf0hosbCE0MPbbgERhh/F0i8FfwHbjAV658ZrILkM a1jrze5D4qMQDfazHoljv8W1Vhbr X-Google-Smtp-Source: APXvYqzIBExYSFGqc2z33T2Botf4sL2oMK9UCSjjEVgHv7NiVYqJw8oTeSDsSkBQp9sPMS8HwhP2Ng== X-Received: by 2002:a2e:8613:: with SMTP id a19mr9316999lji.138.1574372089402; Thu, 21 Nov 2019 13:34:49 -0800 (PST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id x1sm2362470lff.90.2019.11.21.13.34.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Nov 2019 13:34:48 -0800 (PST) Received: by mail-lj1-f181.google.com with SMTP id m4so4893552ljj.8 for ; Thu, 21 Nov 2019 13:34:48 -0800 (PST) X-Received: by 2002:a2e:9904:: with SMTP id v4mr9430770lji.211.1574372088118; Thu, 21 Nov 2019 13:34:48 -0800 (PST) MIME-Version: 1.0 References: <201911211957.xALJvuwi054399@repo.freebsd.org> In-Reply-To: From: Eric Joyner Date: Thu, 21 Nov 2019 13:34:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r354977 - in head: share/man/man3 sys/sys tests/sys/sys To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head , Jacob Keller X-Rspamd-Queue-Id: 47JtBM5Wplz3yYR X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ricera10@gmail.com designates 209.85.208.172 as permitted sender) smtp.mailfrom=ricera10@gmail.com X-Spamd-Result: default: False [-3.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[172.208.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.10)[ip: (-0.32), ipnet: 209.85.128.0/17(-3.17), asn: 15169(-1.97), country: US(-0.05)]; FORGED_SENDER(0.30)[erj@freebsd.org,ricera10@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[172.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[erj@freebsd.org,ricera10@gmail.com]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2019 21:34:53 -0000 On Thu, Nov 21, 2019 at 12:07 PM Conrad Meyer wrote: > Hi Eric, > > On Thu, Nov 21, 2019 at 11:58 AM Eric Joyner wrote: > > > > Author: erj > > Date: Thu Nov 21 19:57:56 2019 > > New Revision: 354977 > > URL: https://svnweb.freebsd.org/changeset/base/354977 > > > > Log: > > bitstring: add functions to find contiguous set/unset bit sequences > > > > Add bit_ffs_area_at and bit_ffc_area_at functions for searching a bit > > string for a sequence of contiguous set or unset bits of at least the > > specified size. > > > > The bit_ffc_area function will be used by the Intel ice driver for > > implementing resource assignment logic using a bitstring to represent > > whether or not a given index has been assigned or is currently free. > > I don't know what the ice driver is/does, so apologies if this is > nonsensical. Would it make more sense to use vmem(9) for this > purpose? It's a general-purpose resource allocator and can scale well > with large numbers of resources / CPUs. > > Best, > Conrad > +Jake Hi Conrad, It doesn't seem nonsensical; this seems like it would vaguely be an ok fit. But one issue I find after looking at it is that it doesn't support the "scattered" allocations that we need; for some types of hardware queues we need to be able to group together multiple non-sequential allocations into one single block, and it doesn't look like we could do that without having to add another layer on top of vmem. As well, it looks like it's kind of overbuilt for what we need; we only need a few operations. It also seems to import a bunch of stuff in its headers, which might complicate using it in our unit test code. If you want to look at the current structure we use, you can look at the ice_pf_qmgr.[ch] files in this Phabricator review that introduces ice(4) to the kernel: https://reviews.freebsd.org/D21959. - Eric