From owner-svn-src-head@FreeBSD.ORG Wed Oct 24 19:08:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34A587A3; Wed, 24 Oct 2012 19:08:35 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 13B448FC08; Wed, 24 Oct 2012 19:08:32 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so684680lag.13 for ; Wed, 24 Oct 2012 12:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=3ZyRIFWg2hMBMkN4D0UbaI4cWfKLku5YqQ4ZPFFPT3s=; b=CsswHx/suuv44x2gRyyopTNSE3+bMGFFgndN66Q/en6AOGySgB4dlFiTRuTMq2CPx8 MexRx9EXYXOJ0P7ZPDxIVLJf1Fv6RsXISgKDWH/4QjTPYRo2GAUKZBXghvXLLZ5YV6OP fXixjD78UpOxKq+F/ta9/h6nrWSYhln8irQkwF7Xq1uEFMIxtYMXVZPojWxNiNic5a9W 5C8RZP8cnx+ZobQZEayH5heMV09+Z/cWd/0zhNbCEb5oUbm3V8wZGk8hCTDVwRNQvI9E j6ry6HaaA8tAYkcnjyKdZQVuLOUbCGPKJx0ne1AIZgktL1ujeZ2yJp0w1wJPIZvsy6sw oEow== MIME-Version: 1.0 Received: by 10.112.28.98 with SMTP id a2mr6609594lbh.110.1351105712101; Wed, 24 Oct 2012 12:08:32 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Wed, 24 Oct 2012 12:08:32 -0700 (PDT) In-Reply-To: References: <201210241836.q9OIafqo073002@svn.freebsd.org> Date: Wed, 24 Oct 2012 20:08:32 +0100 X-Google-Sender-Auth: AF3U2RcOWJ96gpdNJloVHV1uc5E Message-ID: Subject: Re: svn commit: r242014 - head/sys/kern From: Attilio Rao To: Jim Harris Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 19:08:35 -0000 On Wed, Oct 24, 2012 at 7:56 PM, Jim Harris wrote: > On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: >> On 24 October 2012 11:36, Jim Harris wrote: >> >>> Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. >> >> Ok, but.. >> >> >>> struct mtx tdq_lock; /* run queue lock. */ >>> + char pad[64 - sizeof(struct mtx)]; >> >> .. don't we have an existing compile time macro for the cache line >> size, which can be used here? > > Yes, but I didn't use it for a couple of reasons: > > 1) struct tdq itself is currently using __aligned(64), so I wanted to > keep it consistent. > 2) CACHE_LINE_SIZE is currently defined as 128 on x86, due to > NetBurst-based processors having 128-byte cache sectors a while back. > I had planned to start a separate thread on arch@ about this today on > whether this was still appropriate. While you may want to bring CACHE_LINE_SIZE to 64, code in sched_ule should still use CACHE_LINE_SIZE, as MI code cannot make assumption on cache line sizes for all the architectures. Your reasons for using 64 are valid, but a further next step to cleanup CACHE_LINE_SIZE and then use it properly in sched_ule are due IMHO. Attilio -- Peace can only be achieved by understanding - A. Einstein