From owner-svn-src-all@freebsd.org Thu May 11 18:14:46 2017 Return-Path: Delivered-To: svn-src-all@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 13C98D68740; Thu, 11 May 2017 18:14:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E890F1A53; Thu, 11 May 2017 18:14:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5965010A82D; Thu, 11 May 2017 14:14:44 -0400 (EDT) From: John Baldwin To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318171 - head/sys/dev/dpaa Date: Thu, 11 May 2017 10:52:14 -0700 Message-ID: <1565622.4efZRtpFtU@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201705110347.v4B3lwj4009423@repo.freebsd.org> References: <201705110347.v4B3lwj4009423@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 11 May 2017 14:14:44 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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, 11 May 2017 18:14:46 -0000 On Thursday, May 11, 2017 03:47:58 AM Justin Hibbits wrote: > Author: jhibbits > Date: Thu May 11 03:47:58 2017 > New Revision: 318171 > URL: https://svnweb.freebsd.org/changeset/base/318171 > > Log: > Fix uma_zcreate() align argument, now that the constraint is asserted. > > The alignment argument is the mask of low bits to mask off when allocating > items in a zone, not the block-size alignment. The first one should probably be using UMA_ALIGN_PTR instead. However, I do wonder if we shouldn't fix the API. All of the other APIs in the kernel for memory allocation use the size for alignment (contigmalloc, kmem_*, bus_dma, etc.). We could support a transition for uma by doing something like this in the implementation: if (alignment == 0) zone->align = 0; else if (powerof2(alignment)) zone->align = alignment - 1; else { KASSERT(powerof2(alignment + 1), ...); printf("WARNING: UMA zone %s using old alignment\n"); zone->alignment = alignment; } Along with updating the UMA_ALIGN_* constants which should fix most of the zones in the tree to use the new strategy. In 13 we would turn the printf() into a panic() / KASSERT. -- John Baldwin