From owner-freebsd-current@FreeBSD.ORG Fri Oct 1 13:31:18 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15AE6106566B for ; Fri, 1 Oct 2010 13:31:18 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9EAEE8FC0A for ; Fri, 1 Oct 2010 13:31:17 +0000 (UTC) Received: by wwb17 with SMTP id 17so3995896wwb.31 for ; Fri, 01 Oct 2010 06:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=60DDvysFm5jQ8X15gc9nJH17DuOUhFxX9JeTKYpU+10=; b=lsbavQtDY6v7q9iITF4FhziRDYOCXufWMv0++mCuEYw6z3oFmcdBeCT8Ws5JeO66mk T9ZRyhpxPxcvQuMJ1wprxrQDoww9IqqPiESovIdvy0tZE/TK3+6ZqOlR10vv2PM2O2uc UlVIzU+RZzA/LFBCJYDdmCnloiUANHQw6icLc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=klnljI3sAVuSC+oxNcQUaEMzoC7tcq4bslKUmLzslECzjgNU+JqQLHb9R3bv2/8516 hT/i2j3D/nO0OaaDqqeDJRX+qNi+PvZO5zxzmqICIgqAKJJ9qPl/y/16aGZREYPqkZIe 1NgtHr+YlSzQofizkldJCePkI6HdsV2yknwK0= MIME-Version: 1.0 Received: by 10.216.180.200 with SMTP id j50mr2095636wem.36.1285938000119; Fri, 01 Oct 2010 06:00:00 -0700 (PDT) Received: by 10.216.172.210 with HTTP; Fri, 1 Oct 2010 06:00:00 -0700 (PDT) Date: Fri, 1 Oct 2010 15:00:00 +0200 Message-ID: From: Svatopluk Kraus To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: CACHE_LINE_SIZE too small, so struct vpglocks size alignment doesn't work X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2010 13:31:18 -0000 Hallo, a size of 'struct vpglocks' is padded to CACHE_LINE_SIZE size in 'sys/vm/vm_page.h' header file. I work on a 'coldfire' port where CACHE_LINE_SIZE is 16 bytes and sizeof(struct mtx) is 20 bytes thus size alignment doesn't work. I solved it somehow, but I like to learn how to solve it in spirit of FreeBSD. There are a couple of possibilities: A1. Do nothing for small CACHE_LINE_SIZE. A2. Pad to multiple of CACHE_LINE_SIZE. B1. use #if with CACHE_LINE_SIZE B2. use #if with __coldfire__ When I use B1 solution I need to known sizeof(struct mtx) value in preprocessing time. So, is it correct to use something like 'assym.s' magic (sys/i386/i386/genassym.c) in MI code? Or has someone another suggestion? Regards, Svata