Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261963AbUJYVRO (ORCPT ); Mon, 25 Oct 2004 17:17:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262042AbUJYVJU (ORCPT ); Mon, 25 Oct 2004 17:09:20 -0400 Received: from pollux.ds.pg.gda.pl ([153.19.208.7]:58634 "EHLO pollux.ds.pg.gda.pl") by vger.kernel.org with ESMTP id S262022AbUJYVA4 (ORCPT ); Mon, 25 Oct 2004 17:00:56 -0400 Date: Mon, 25 Oct 2004 22:00:48 +0100 (BST) From: "Maciej W. Rozycki" To: Andi Kleen Cc: Corey Minyard , linux-kernel@vger.kernel.org Subject: Re: Race betwen the NMI handler and the RTC clock in practially all kernels II In-Reply-To: <20041025204144.GA27518@wotan.suse.de> Message-ID: References: <417D2305.3020209@acm.org.suse.lists.linux.kernel> <20041025201758.GG9142@wotan.suse.de> <20041025204144.GA27518@wotan.suse.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 785 Lines: 18 On Mon, 25 Oct 2004, Andi Kleen wrote: > So it's impossible to check the old value. The original code is the only > way to do this (if it's even needed, Intel also doesn't say anything > about this bit being a flip-flop). Only possible change would be to > write an alternative index. You can't read the old value, but you can have a shadow variable written every time the real index is written. Since NMIs are not preemptible and this is a simple producer-consumer access, no mutex around accesses to the variable is needed. Maciej - 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/