From owner-svn-src-all@freebsd.org Fri Mar 23 02:36:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F5ADF622FC; Fri, 23 Mar 2018 02:36:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::234]) (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 0216B7ADF6; Fri, 23 Mar 2018 02:36:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x234.google.com with SMTP id q11so11182651qtl.9; Thu, 22 Mar 2018 19:36:42 -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=BvixQ4uByB/yZ8W/K8iK6nHz/H5dPuXCD8nkN4rLwjg=; b=KFHYVWgLd9fkUr4WH6qAlDCLTp8uuw6iD7torv52vBO9U07zbhriCEDYom+oUaTKYb w6/azmBY2bC7yAhQz2iHy/24hgxAO5ZS8SMhSZpu5y7sIJ3yCrclC8r6WVLdgPtQ7uRe HNI6mKLqKHzwLhAhj5ZdcsuBw4c4sJ7V0GPMWeeqDwBj3DoTHdumfZfriZWwDCLpkMYP hQjN4SFFjC2BEfjVTc/ePcd7GlbRcszxRJo+MLma+gJCv6HZBIUEGDk2GLyR6lRxemzs +1YCu0oTmTWvqC/yN42jxy44VqiEMRdDjJFRHY9370U9UmgesbAYOLen9alZnLBku/4Z 6EIA== 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=BvixQ4uByB/yZ8W/K8iK6nHz/H5dPuXCD8nkN4rLwjg=; b=nsODck0nYx4y7F8h7dcXTyiWZl25P/PvnoerL29rqIHdIt56ZS3qozJRV5Exxl6q2F ncXFQJoRdtdi+VexxM8B+KS1BkEloz1lurxxnyP9C71Qo1FBS3dQJXre9l+2qCGNgUw1 UgoiZxlTF2D1/n237vrp66A56ye4Yj+tmVaymVXT5kkpk4ree2P33iBrGUyH6DKfjDDr F5hRAlj/eLKaZY37PnP6QPpUMwIlmxcYN4sH3eiZVTb9MuBUYTpYjtZobKHsFPfGSy/v ImRE0HaVzX2KnVApDQe9+ds0oI3pvApm1ukjz935iglF5v/QaKipbJ91W+xJ/+VNqkqN 50tw== X-Gm-Message-State: AElRT7EQHGmarimDnucw6rc0LvX00VZRQADIE3LJVr8wueFymyNMVFO8 lOVxTy7HMHbm2cf9BNR3MIfBjAU8CD5aMMxbiUWuJg== X-Google-Smtp-Source: AG47ELuDdDGNle14rfWYPlbls+teCyMcVg49KaBjKaqZhYpqlgr94d8Z6DT/rHARcLneyvk261ypEo2dKT5VjB1VPCk= X-Received: by 10.237.62.243 with SMTP id o48mr37520818qtf.3.1521772602095; Thu, 22 Mar 2018 19:36:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.36.52 with HTTP; Thu, 22 Mar 2018 19:36:41 -0700 (PDT) In-Reply-To: <201803230215.w2N2F6wL070720@repo.freebsd.org> References: <201803230215.w2N2F6wL070720@repo.freebsd.org> From: Mateusz Guzik Date: Fri, 23 Mar 2018 03:36:41 +0100 Message-ID: Subject: Re: svn commit: r331404 - in head: cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/u... To: Alexander Motin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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, 23 Mar 2018 02:36:43 -0000 On Fri, Mar 23, 2018 at 3:15 AM, Alexander Motin wrote: > Author: mav > Date: Fri Mar 23 02:15:05 2018 > New Revision: 331404 > URL: https://svnweb.freebsd.org/changeset/base/331404 > > Log: > MFV r331400: 8484 Implement aggregate sum and use for arc counters > > In pursuit of improving performance on multi-core systems, we should > implements fanned out counters and use them to improve the performance of > some of the arc statistics. These stats are updated extremely frequently, > and can consume a significant amount of CPU time. > > > > Due to seriously fat locks this struct: typedef struct aggsum_bucket { kmutex_t asc_lock; int64_t asc_delta; uint64_t asc_borrowed; uint64_t asc_pad[4]; /* pad out to cache line (64 bytes) */ } aggsum_bucket_t __aligned(CACHE_LINE_SIZE); ends up using *two* cache lines. Without asc_pad the size is 48 bytes. asc_pad adds 4 * 8 = 32 which pushes it to the next line for no good reason. That said, I suggest #ifndefing it the field. -- Mateusz Guzik