Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932408AbbBLMg1 (ORCPT ); Thu, 12 Feb 2015 07:36:27 -0500 Received: from casper.infradead.org ([85.118.1.10]:43794 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755166AbbBLMgZ (ORCPT ); Thu, 12 Feb 2015 07:36:25 -0500 Date: Thu, 12 Feb 2015 13:36:20 +0100 From: Peter Zijlstra To: Jiri Kosina 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 Message-ID: <20150212123620.GB23367@worktop.ger.corp.intel.com> References: <2c3d1e685dae5cccc2dfdb1b24c241b2f1c89348.1423499826.git.jpoimboe@redhat.com> <20150212032121.GA18578@treble.redhat.com> <20150212115628.GL2896@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1298 Lines: 31 On Thu, Feb 12, 2015 at 01:25:14PM +0100, Jiri Kosina wrote: > 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. Barriers are about order, you need two consecutive stores for a wmb to make sense, and two consecutive reads for an rmb, and if they're paired the stores and reads need to be to the same addresses. Without that they're pointless. The comment doesn't describe which two variables are ordered how. -- 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/