From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755526Ab0IFSUo (ORCPT ); Mon, 6 Sep 2010 14:20:44 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:33217 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115Ab0IFSUk convert rfc822-to-8bit (ORCPT ); Mon, 6 Sep 2010 14:20:40 -0400 Subject: Re: [PATCHv11 2.6.36-rc2-tip 3/15] 3: uprobes: Slot allocation for Execution out of line(XOL) From: Peter Zijlstra To: Srikar Dronamraju Cc: Ingo Molnar , Steven Rostedt , Arnaldo Carvalho de Melo , Linus Torvalds , Christoph Hellwig , Masami Hiramatsu , Oleg Nesterov , Mark Wielaard , Mathieu Desnoyers , Andrew Morton , Naren A Devaiah , Jim Keniston , Frederic Weisbecker , "Frank Ch. Eigler" , Ananth N Mavinakayanahalli , LKML , "Paul E. McKenney" , Srivatsa Vaddagiri In-Reply-To: <20100906175957.GH14891@linux.vnet.ibm.com> References: <20100825134117.5447.55209.sendpatchset@localhost6.localdomain6> <20100825134156.5447.43216.sendpatchset@localhost6.localdomain6> <1283415812.2059.1825.camel@laptop> <20100902174712.GA14891@linux.vnet.ibm.com> <1283498777.1783.45.camel@laptop> <20100906175957.GH14891@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Mon, 06 Sep 2010 20:20:24 +0200 Message-ID: <1283797224.1930.745.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2010-09-06 at 23:29 +0530, Srikar Dronamraju wrote: > > Lets say the thread while singlestepping the process gets > pre-empted. Eventually the cpu might run some other thread of the same > process before picking the first run thread. Or the first run > thread could after migration due to load balancing or whatever end up > running on a different thread? How do we handle these cases? So assuming we're preempted while the IP is inside the slot: On the preempt-out we store the slot relative ip (ip - start_of_slot), on preempt-in we write the replacement instructions in our cpu slot (could be the same cpu, could be another) and re-position the ip to point to the same relative position inside that slot, then go! It really doesn't matter what happens in between.