From owner-freebsd-arch@freebsd.org Sat Sep 16 06:55:20 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5584E0497F for ; Sat, 16 Sep 2017 06:55:20 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82A096B3E5 for ; Sat, 16 Sep 2017 06:55:20 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-lf0-x229.google.com with SMTP id m199so4165862lfe.3 for ; Fri, 15 Sep 2017 23:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9V4nbTznLKqZ1oT7WnBNgtjvPpLZioSOd8iyM/Ghhfg=; b=Q9RPvrmwW0TK4P5dm1PqNyLEttvcxcvVS6CTAxAC1hchDG3iSoBB46g+rSifd/HRAT 2dMWlRjYPSEFV3+C3WtWBZ+II46aFf3+vwq2uXqLVMw114lv7R58utbOKkEdvcsKZs0K 4rDpGav+AY45q0TgS+lCPBO8qjsmeWqi11oPEQze14pOl96iF09iu1xvL1e2nELnZCbu 3RtQdhLiCLHx5ZDIymCDvcXLdQ9AGrnJVaH5EclhykRYKI33AhOheIQQU8nTCTrVpNfS AqJqZwF47grQ8QvrPEv6aaSm4e1OCB42FQAWEEzJuf2+5oDV80ebMSqP0NbpR+rnTwen LpqA== 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=9V4nbTznLKqZ1oT7WnBNgtjvPpLZioSOd8iyM/Ghhfg=; b=cpkpIZns0LS0zw3jpuuUTUh6AYHEs3mRMS0i/8W5p/E8aE1o5SrqrrCB1mbUcd1dDY B5cP1quL95SrU7Tgj3NrFetJupv6xFTUn4JAJFT/HHVCEqrcQK83SI5P5WBmKghRRpEC UYmEc6zuGZnjfWlGAbbOlwGsN5k3JNW/7uHvUow8Q7PiPSf3smk47tPjsWvi0i+IgJyd zrHVyEP7K+jnBIgFr8yZegXIkCwQk1Z74DWUpYDpuXuS007x3wW/6jOKallDXp6etGtK r60Tj35Ie/ZfhkvqKCU7co/8P9QVy7ksaxO6l/bkOQZKD7/qczt3DsYaSg3Z5rGR/5Pv ay4A== X-Gm-Message-State: AHPjjUgueIfXtH9TsTF+8vu1SuPECBsuirTc0txfcyDmoTr76X4MiPfO nO1tTNshc6WH3EHlQsnchvu+2OJU5y/o8xoLmXzJ7K53 X-Google-Smtp-Source: AOwi7QAJI9q+qz7nRO7OdSzhfavlAFyrNfowttChqmNVxN0rG5ttj5aY5bLxpPZyghx17xaQXZuqWnpkDilj9Gc6Q1E= X-Received: by 10.25.92.68 with SMTP id q65mr1325370lfb.206.1505544918548; Fri, 15 Sep 2017 23:55:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.142.68 with HTTP; Fri, 15 Sep 2017 23:54:47 -0700 (PDT) In-Reply-To: <10066620.9raPCKhsf8@ralph.baldwin.cx> References: <10066620.9raPCKhsf8@ralph.baldwin.cx> From: Ed Schouten Date: Sat, 16 Sep 2017 07:54:47 +0100 Message-ID: Subject: Re: UMA and zone alignment To: John Baldwin Cc: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2017 06:55:20 -0000 2017-09-16 0:38 GMT+01:00 John Baldwin : > I think I'd like to add UMA_ALIGNOF() and encourage UMA zones to use > UMA_ALIGNOF(type) instead of UMA_ALIGN_PTR, etc. going forward. This would > mean UMA would then honor 'struct foo { ... } __aligned(XX)', etc. What do > you all think? Awesome! Random remark: it looks like uma_zcreate() already takes the size of the objects to allocate without any wrapping; it's just sizeof(...). Wouldn't we be able to do this for alignment as well? More specifically, if all of the UMA_ALIGN_* definitions were incremented by one and uma_zcreate() decrements it, we could eliminate the UMA_ALIGNOF() macro entirely and simply use _Alignof() at the call site directly. If people don't like _Alignof()'s spelling, we could always consider making something like available in kernel space. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands