From owner-svn-src-all@freebsd.org Fri Oct 30 15:42:44 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 15F3A454B1F; Fri, 30 Oct 2020 15:42:44 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 4CN65H31Dkz470c; Fri, 30 Oct 2020 15:42:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42e.google.com with SMTP id k10so5619636wrw.13; Fri, 30 Oct 2020 08:42:43 -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=5m9fox3XoAXccFwS/GIKFQMCVqiGETpGY7Rpp2t3bqg=; b=rnKV1b2p/3j9e4huJNkY3I7GJc9MlDTMrX+MnJZGsqrWLjCRHRSo2m/dV8DHNJZtrW jgi4djUOKeJ3LpEDBCSn+Lr1RVHhElZn2DxnipwMYnFxm2vICx4goU5Svb4pmA82QFAz XNP9GIVre0I8SlasZijxV/3/okP31HhUe62Lwz7LkMWeUHKPYlrJR5jxxi309pIKSYrr 63oR4U8ufH/2kiDCFyvge0vKK+ZIRHJDpCDYmPngx2r2J+iXS4axJ+Otbie1bsCstvNb ocBeIqrDNvGBnnrOMRmEQgOZ87EJm/OcyLIUDqGYT2yHYmTN2iu5iivkb+oOPMdzcuWT wN2Q== 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=5m9fox3XoAXccFwS/GIKFQMCVqiGETpGY7Rpp2t3bqg=; b=KDIsOBXLKdI8cOZkjd0l0RZCwwNiF4X0rwTIfgUlXTtQpmLUnv/FdCfE4CDmHkiSW+ EecI8ehoF3+g0zoil64mom9DlhF+zLSshjBd5Bv8QmEoSwFUkjp5fAOsM7GpQud6C4UR MdnF1uLPQdOgzjINLmNAZv6btYBYwlMdbSvDnn7Lr/GXLMAUgnErAIxYg4YJ6802YE+h /SSLJ8iBIQZcByw/VJIdGK6z9kfmhyp3hVUqlfPEJdi93+ep5F60cTl0rb4ozXAohD0y ZmD11T+PXzstWE0TP/b9C/QsZj3t7Ya8MgznjVnt1WboMI5E+5n+HB2Kiyu5HGeyxufY SjdA== X-Gm-Message-State: AOAM530FwLxjS7UooFLfV3qYj2Ufcuz4bHbhhBFnoktjzDd/nhgJvsC8 Jm0fsVyFAw4BBColj7APJuvodUQJJpmV/bDVocQ= X-Google-Smtp-Source: ABdhPJyCEWStwBwQPV4YWDFTMEAfkCqlVPvLOzJfQuSWb037OnognrHqm9eYSugoz9TJoJ4qMmXTGorpS5E+hg1xDr8= X-Received: by 2002:adf:9043:: with SMTP id h61mr4026950wrh.237.1604072560776; Fri, 30 Oct 2020 08:42:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:4c4f:0:0:0:0:0 with HTTP; Fri, 30 Oct 2020 08:42:39 -0700 (PDT) In-Reply-To: <20201030143851.GE2654@kib.kiev.ua> References: <202010301407.09UE7Phw060731@repo.freebsd.org> <20201030143851.GE2654@kib.kiev.ua> From: Mateusz Guzik Date: Fri, 30 Oct 2020 16:42:39 +0100 Message-ID: Subject: Re: svn commit: r367165 - head/sys/fs/tmpfs To: Konstantin Belousov 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: 4CN65H31Dkz470c X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=rnKV1b2p; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::42e as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.73 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.002]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.28)[0.279]; NEURAL_HAM_LONG(-1.01)[-1.011]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::42e:from]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] 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:42:44 -0000 On 10/30/20, Konstantin Belousov 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. > > Either commit message or follow-up do not explain why stopping using > zone for dirents is useful. Intuition says exactly reverse, dirents > on tmpfs are allocation-intensive typically. > Off hand the only reasons to use a dedicated zones that I see are: - use of any of the routines on object creation/destruction - non-standard flags like NOFREE - SMR - high expected allocated count with sizes poorly fit for malloc Since malloc itself is implemented on top of zones, the difference before/after the patch is that now it can re-use the pre-existing 64 byte buckets instead of creating its own copy. The above follow up was to address potential comments about the size changing from 64 -- with better malloc granularity this wont be a big deal. Also note tmpfs already uses malloc to store names. If anything in my opinion the kernel has unnecessary zones (like the vnode poll one I patched prior to this). -- Mateusz Guzik