From owner-svn-src-head@freebsd.org Thu Nov 21 21:34:52 2019 Return-Path: Delivered-To: svn-src-head@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 DBA261CB826 for ; Thu, 21 Nov 2019 21:34:52 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 47JtBM5rG1z3yYV for ; Thu, 21 Nov 2019 21:34:51 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-lf1-f42.google.com with SMTP id b20so3836613lfp.4 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=IXpMa3BW+tdseu/XXVsQ9tcQIY9WvT8rgdbs3+6l5Ym1ar0g42Cd1o3kLFBJ+6QKAG YqR9R/TPtXAiZPu2tKSTeWVHLhTiPiB1nThHt+XDUjNICYt5H61lLuCLJVapbNXzyjZj AoLYBKhyzAJjqNDWQNmioX+F+YnQNm1r7eqDpp3RNmxuC0omMPXBehIlsPMTO3SNRYql X7veWJfVl8bG3uQhaYqs0DTCbIFWvGhx+QbepCJUEpHkAELWHfumOS460VeRjexpKjHI Pr+1dWNlcMqz0ubR9BdKrbTRf3L9CX8byDMKzUdm6IEENQsky+TMnzM47LqkvhcFUzwy AwKg== X-Gm-Message-State: APjAAAXLnr6SDkGf2iOj5QbMgJ8qrATZxW5mpHwLrnhLq8/CtrUCqMj8 r5/TOFYBGhpP2V1Jgda9fo+CiZZU X-Google-Smtp-Source: APXvYqzlTQesXzOMgSeRaCGVs3G0yK5xrCWzSBmcjbIdLllsRo23yG8ORcllRzwB2mBpw5Zc0YkO8Q== X-Received: by 2002:ac2:44a9:: with SMTP id c9mr9349905lfm.26.1574372089320; 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 u23sm2100134lfc.88.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 v8so4913089ljh.5 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: 47JtBM5rG1z3yYV 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.167.42 as permitted sender) smtp.mailfrom=ricera10@gmail.com X-Spamd-Result: default: False [-3.12 / 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@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)[42.167.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.12)[ip: (-0.43), 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)[42.167.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2019 21:34:52 -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