Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756404AbbBJOno (ORCPT ); Tue, 10 Feb 2015 09:43:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48195 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbbBJOnl (ORCPT ); Tue, 10 Feb 2015 09:43:41 -0500 Date: Tue, 10 Feb 2015 08:43:30 -0600 From: Josh Poimboeuf To: Jiri Kosina Cc: Seth Jennings , Vojtech Pavlik , Masami Hiramatsu , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/9] livepatch: consistency model Message-ID: <20150210144330.GA21643@treble.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1660 Lines: 33 On Tue, Feb 10, 2015 at 09:57:44AM +0100, Jiri Kosina wrote: > On Mon, 9 Feb 2015, Josh Poimboeuf wrote: > > > 2) As mentioned above, kthreads which are always sleeping on a patched function > > will never transition to the new universe. This is really a minor issue > > (less than 1% of patches). It's not necessarily something that needs to be > > resolved with this patch set, but it would be good to have some discussion > > about it regardless. > > > > To overcome this issue, I have 1/2 an idea: we could add some stack checking > > code to the ftrace handler itself to transition the kthread to the new > > universe after it re-enters the function it was originally sleeping on, if > > the stack doesn't already have have any other to-be-patched functions. > > Combined with the klp_transition_work_fn()'s periodic stack checking of > > sleeping tasks, that would handle most of the cases (except when trying to > > patch the high-level thread_fn itself). > > > > But then how do you make the kthread wake up? As far as I can tell, > > wake_up_process() doesn't seem to work on a kthread (unless I messed up my > > testing somehow). What does kGraft do in this case? > > wake_up_process() really should work for (p->flags & PF_KTHREAD) > task_struct. What was your testing scenario? Hm, I probably did something stupid. I'll try it again :-) -- Josh -- 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/