Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751033AbWI3Ohw (ORCPT ); Sat, 30 Sep 2006 10:37:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751034AbWI3Ohw (ORCPT ); Sat, 30 Sep 2006 10:37:52 -0400 Received: from smtp103.mail.mud.yahoo.com ([209.191.85.213]:57502 "HELO smtp103.mail.mud.yahoo.com") by vger.kernel.org with SMTP id S1751032AbWI3Ohv (ORCPT ); Sat, 30 Sep 2006 10:37:51 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=qxb5fD8EtcHx1ppYGWooCktkKp2r7eclP2TtpRi2Z2o9ciLWQ1Qoazzw3n+3etjuHUHD7Kmx2mC3WUqyeoOUYnY0Y0WkE+3mddaNsEe5vWAT6LClMlE4Icv99MmUktFfVWTwcjh2zMavpN/ftF22E3IiwNq0FAAqzEIOwWNrB34= ; Message-ID: <451E8143.5030300@yahoo.com.au> Date: Sun, 01 Oct 2006 00:37:55 +1000 From: Nick Piggin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1 X-Accept-Language: en MIME-Version: 1.0 To: Dong Feng CC: Christoph Lameter , Andi Kleen , Arjan van de Ven , Paul Mackerras , David Howells , linux-kernel@vger.kernel.org Subject: Re: How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1352 Lines: 37 Dong Feng wrote: > 2006/9/30, Christoph Lameter : > >> On Fri, 29 Sep 2006, Dong Feng wrote: >> >> > If the comments mean the subsequent code is SMP-safe and can prevent >> > nest-kernel-path, how does it achieves that? >> >> It relies on locking outside of do_sys_settimeofday(). Seems that this >> indicates locking is to be performed by the arch before calling >> do_sys_settimeofday. Looks suspicious to me. Check that this function is >> always called with the same lock. >> > > Yes, that is the question. The whole invocation path is > sys_settimeofday() -> do_sys_settimeofday() > > I do not find a lock embracing do_sys_settimeofday(). > > Moreover, seems neither write operations nor read operations on sys_tz > is protected by any locks, in sys_gettimeofday() and > sys_settimeofday() respectively. Did you get to the bottom of this yet? It looks like you're right, and I suggest a seqlock might be a good option. You should write a patch and send it to Mister Morton. -- SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com - 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/