From owner-svn-src-all@freebsd.org Fri Oct 30 15:36:06 2020 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 8653B4548C5; Fri, 30 Oct 2020 15:36:06 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4CN5xf1lDbz46fx; Fri, 30 Oct 2020 15:36:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x335.google.com with SMTP id w23so3236832wmi.4; Fri, 30 Oct 2020 08:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Witx/dWeekJbGIGFSQLqx56JG2AGyfQvDqbO63+rVlw=; b=VsEOBXcqnM9QMUSWTlLBQULpgQp7gk5hj8VMCOAz87kBY4eNN6XV4/hNGCkBm8oxIJ YOAPQu3GzpI3IsDAUp1584H3wh9XTyhiGf0OOs5WBUpY4asKuuBeH/p8JO/APqDXh2yc QJoyQHhLL2O54zdmCaMezJnFHXx9bqyqYN6nqUl+YLyhU/0FKqcY6vrqBJiiCs7r9c0L maYOt/dyXJ4jQhciXiIe/spX+j5E9r/h6OBMpxXY0txfSLli6F0qbmXVqDFVTV6Bl6Pp jw+1VkO4dptef37AqwTXnMMKcjdX4puVM6gHAlWkiaQg6fgadeDGne/aicyqSyX9br+T j21Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Witx/dWeekJbGIGFSQLqx56JG2AGyfQvDqbO63+rVlw=; b=CyCUYeyGieOtcq+dez6r0r+g8WyDbc95BPhF50mAxkhD+8r4k67fIPMaVciOW2oqed IE4biWRNrP4QHnVoxjyXX7y2+wIs3WrWjHD/1BmvmlmLcoXNNvL46Uprl1v59uzw+TwA W9Hz+46mOqaJUNqOcFX49VL0e6dHvh2r5/MWAmQemCiwQTLAiOPFZl+Um6F2pdi9Yfun fY8SYQ6bgvm0hX7xmXM7ZXuYx0XZWBz3sWYsOLo5ZOy3pvM7TlVP62L1OqBS2W7AZm3s 1aqM7s+Jne9OW3QPigMkehfNZT6eEgLa/chkMwI8zRXKrHfQZBMjGvcPrVhgThww6A/+ wu1A== X-Gm-Message-State: AOAM530WYk2oXxdr+xzKy6lXw4gwezao10lUkpcuXMTNHYL+Senxy0x2 E3xPgwELFxtU0UfROB8xuZw5K7A8XvTkFcCCVATjW4v76q8= X-Google-Smtp-Source: ABdhPJyCgNSGAPxEMNSzA5CPdY8l2Q65wf01cwv7T4ItinFxv+S/b3V+nFkJSf8hOdy+7+4T7zDJ/M7DD4FcQCxgxLo= X-Received: by 2002:a7b:c451:: with SMTP id l17mr3393155wmi.127.1604072164287; Fri, 30 Oct 2020 08:36:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:4c4f:0:0:0:0:0 with HTTP; Fri, 30 Oct 2020 08:36:03 -0700 (PDT) In-Reply-To: <20201030145143.GB60293@raichu> References: <202010301407.09UE7Phw060731@repo.freebsd.org> <20201030145143.GB60293@raichu> From: Mateusz Guzik Date: Fri, 30 Oct 2020 16:36:03 +0100 Message-ID: Subject: Re: svn commit: r367165 - head/sys/fs/tmpfs To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CN5xf1lDbz46fx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 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: Fri, 30 Oct 2020 15:36:06 -0000 On 10/30/20, Mark Johnston wrote: > On Fri, Oct 30, 2020 at 03:08:32PM +0100, Mateusz Guzik wrote: >> On 10/30/20, Mateusz Guzik wrote: >> > Author: mjg >> > Date: Fri Oct 30 14:07:25 2020 >> > New Revision: 367165 >> > URL: https://svnweb.freebsd.org/changeset/base/367165 >> > >> > Log: >> > tmpfs: change tmpfs dirent zone into a malloc type >> > >> > It is 64 bytes. >> > >> >> Right now malloc has only power-of-2 zones but I'm looking into >> changing that. The allocator itself trivially extends to multiply of >> 16, but stat collection needs reworking. > > Sums of consecutive powers of 2 also works well. That is, 16, 16 + 8, > 32, 32 + 16, ... > > When I last looked I didn't see very many places that would benefit, at > least outside of ZFS. Probably the main one is CAM CCBs, and that'll be > helped by https://reviews.freebsd.org/D26844 . > I collected stats over part of make tinderbox, where they are rounded up to mulitplies of 8. (so size of 5 is 1, size of 32 is 4). There is huge demand for non-power-of-2 and a multiply of 16 is a conservative adjustment which wont require more than a few workloads to compare before/after. For example you can see a solid contingent of 9 (72 bytes) which right now is served from 128 byte zones. dtrace -n 'fbt::malloc:entry { @ = lquantize(arg0 % 8 ? ((arg0 / 8) * 8 + 1) : arg0 / 8, 0, 32, 1); }' value ------------- Distribution ------------- count 0 | 0 1 | 292436 2 | 140962 3 | 322732 4 |@@@@@ 12150230 5 | 686069 6 | 41067 7 |@ 2847728 8 |@@@ 6449825 9 |@@ 5794112 10 | 1107100 11 | 5913 12 | 15392 13 | 21885 14 | 1852 15 | 4100 16 | 5177 17 |@ 1833685 18 | 1541 19 | 1567 20 | 1189 21 | 809 22 | 7294 23 | 423 24 | 355 25 | 364280 26 | 450 27 | 416 28 | 444 29 | 193 30 | 83 31 | 188 >= 32 |@@@@@@@@@@@@@@@@@@@@@@@@@@ 61740786 -- Mateusz Guzik