Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755745AbbBLMjz (ORCPT ); Thu, 12 Feb 2015 07:39:55 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59966 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754052AbbBLMjx (ORCPT ); Thu, 12 Feb 2015 07:39:53 -0500 Date: Thu, 12 Feb 2015 13:39:51 +0100 (CET) From: Jiri Kosina To: Peter Zijlstra cc: Josh Poimboeuf , Ingo Molnar , Masami Hiramatsu , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Seth Jennings , Vojtech Pavlik Subject: Re: [RFC PATCH 6/9] livepatch: create per-task consistency model In-Reply-To: <20150212123620.GB23367@worktop.ger.corp.intel.com> Message-ID: References: <2c3d1e685dae5cccc2dfdb1b24c241b2f1c89348.1423499826.git.jpoimboe@redhat.com> <20150212032121.GA18578@treble.redhat.com> <20150212115628.GL2896@worktop.programming.kicks-ass.net> <20150212123620.GB23367@worktop.ger.corp.intel.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1301 Lines: 35 On Thu, 12 Feb 2015, Peter Zijlstra wrote: > > > FWIW, the barriers in klp_update_task_universe() and > > > klp_set_universe_goal() look like complete crack, and their comments are > > > seriously deficient. > > > > These particular barriers seem correct to me; you basically need to make > > sure that whenever a thread with TIF_KLP_NEED_UPDATE goes through > > do_notify_resume(), it sees proper universe number to be converted to. > > I'm not seeing how they're going to help with that. > > The comment should describe the data race and how the barriers are > making it not happen. > > putting wmb after a store and rmb before a read doesn't avoid the reader > seeing the old value in any universe I know of. This is about dependency between klp_universe_goal and TIF_KLP_NEED_UPDATE in threadinfo flags. What is confusing here is that threadinfo flags are not set in klp_set_universe_goal() directly, but in the caller (klp_start_transition()). I fully agree with you that this deserves better comment though. -- Jiri Kosina SUSE Labs -- 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/