Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 31 Oct 2001 09:32:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 31 Oct 2001 09:32:21 -0500 Received: from chaos.analogic.com ([204.178.40.224]:64640 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id ; Wed, 31 Oct 2001 09:32:07 -0500 Date: Wed, 31 Oct 2001 09:31:39 -0500 (EST) From: "Richard B. Johnson" Reply-To: root@chaos.analogic.com To: vda cc: Tim Schmielau , linux-kernel@vger.kernel.org Subject: Re: [Patch] Re: Nasty suprise with uptime In-Reply-To: <01103115390007.00794@nemo> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1678434306-1659251687-1004538699=:9270" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1678434306-1659251687-1004538699=:9270 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Oct 2001, vda wrote: [SNIPPED...] > Hmm.... 64bit jiffies are attractive. > > I'd like to see less #defines in kernel > Some parts of your patch fight with the fact that jiffies > is converted to macro -> it is illegal now to have local vars > called "jiffies". This is ugly. I know that there are tons of similarly > (ab)used macros in the kernel now but let's stop adding more! > > This test prog shows how to make overlapping 32bit and 64bit vars. > It works for me. > > #include > typedef unsigned long long u64; > > extern u64 jiffies_64; > extern unsigned long jiffies; > extern unsigned long jiffies_hi; > > asm( > " .bss\n" > " .align 8\n" > ".globl jiffies_64\n" > ".globl jiffies\n" > ".globl jiffies_hi\n" > "jiffies_64:\n" > // <- a bunch of ifdefs needed here to sort out endianness stuff... > "jiffies:\n" > " .zero 4\n" > "jiffies_hi:\n" > " .zero 4\n" > > //not working!? how to return to prev .data/.text/whatever? > //I don't know gas... > //" .previous\n" > ); > > int main() { > jiffies_64 = 0xFEDCBA9876543210UL; > printf("lo: 0x%08x\n",jiffies); > printf("hi: 0x%08x\n",jiffies_hi); > return 0; > } > > Is this better or not? If not, why? > -- > vda The problem is that a 64-bit jiffies on a 32-bit machine would require a spin-lock every time the jiffies variable is changed! This is because there are two (or more) memory accesses for every 64 bit operation, plus two or more register accesses for every 64 bit operation. If a context-switch or an interrupt occurs between those operations, all bets are off about the result. The appended small tar.gz file contains some 64-bit assembly plus some 64-bit C, Look at the assembly and it will become obvious to you that you don't want to use a 64-bit timer on a 32 bit machine. Cheers, Dick Johnson Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips). I was going to compile a list of innovations that could be attributed to Microsoft. Once I realized that Ctrl-Alt-Del was handled in the BIOS, I found that there aren't any. --1678434306-1659251687-1004538699=:9270 Content-Type: APPLICATION/octet-stream; name="64bits.tar.gz" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: H4sIAHsJ4DsAA+1afWgc1xF/K50+7mLHkh0ncurQbSxRqZXWt9JJlp2P+kOy LSLbQpbrpCTZnO72dOecbsXdypFJQpNcDHFVg0qLA8W0dZtC/kghUFPapgQV B0JpCqaY0oL/cEtbzvSDhgQnENPrzHtvd2dXJ7utLYe0O2bv7cz83pv3OTvz 5IHEZM4ubWYrSWoivqW/X2UqUjxQSkbd0rclHo8n+nt7VVWP6/29TO1f0V5J mi3ZyaKqsqJl2dfCXU//CaUBsf77kk+amVzeXBEbejw+kEgsv/69iS3O+vcN 6Lj++sAWnanxFelNgP7P1z8WS+bz26JR2yzZA4lYLCY2hGZti8q3g7FoNFlS eyzVUamuJiaqufW1lAuCWlOplNpzGNpXew70YgMCpC7FxlJ5M1nYBnWK02pP xgF6+o97mv5nSZ5/Z0VXxMZ1zr8+0K+75x8YPP/9el94/m8FxWJayUzZOasQ 1dJJOxmLHcllMjmztC2q5a3CVDQe3aSOWk+pyDxlFdNqp1VQRwq2me9yoEY2 R9F7c1NZFw4eZWT/2KEJY/TAYfUBNT4XT0jB3hFVCAZpH2xzzo7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wy7MNLSUmwqleo1IGyayeXNtMZGx8Z1/OllqaJdsmczGcDMYGJrDE0c GDdGRw5OQKaNFfKQ46a1PtCkLUP8zdrgkZmRnJ0D6fBeY/f4jn3Dxs7hPSP7 oRJaNNKz09PHmPjTuzbIeGAnhTwFF68Zq5gyDdsyZP68i9im9lLEHscM7x/i kCHKiG4Izv1D9rXve528371HcBL6JfcAzi1C2iyaU7kSBMIiWgV5xnLvA5Zc MtCLZHo/gH+OZDhqybsYHhnLWwl6w0xvoZ37htqXHnjzQO+peVOGQYwZRs0x +G9ZQgoppJBCCimkkEIKKaSQQgoppJBCCimkkEIKKaSQQgoppJBCCimkkEIK KaRPCv0L3Sh9jgBQAAA= --1678434306-1659251687-1004538699=:9270-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/