Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753644AbbBJO7M (ORCPT ); Tue, 10 Feb 2015 09:59:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49236 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbbBJO7J (ORCPT ); Tue, 10 Feb 2015 09:59:09 -0500 Date: Tue, 10 Feb 2015 08:59:04 -0600 From: Josh Poimboeuf To: Masami Hiramatsu Cc: Seth Jennings , Jiri Kosina , Vojtech Pavlik , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 6/9] livepatch: create per-task consistency model Message-ID: <20150210145904.GC21643@treble.redhat.com> References: <2c3d1e685dae5cccc2dfdb1b24c241b2f1c89348.1423499826.git.jpoimboe@redhat.com> <54D9E456.2020704@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54D9E456.2020704@hitachi.com> 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: 1237 Lines: 39 On Tue, Feb 10, 2015 at 07:58:30PM +0900, Masami Hiramatsu wrote: > (2015/02/10 2:31), Josh Poimboeuf wrote: > > +/* > > + * Try to safely transition a task to the universe goal. If the task is > > + * currently running or is sleeping on a to-be-patched or to-be-unpatched > > + * function, return false. > > + */ > > +static bool klp_transition_task(struct task_struct *t) > > +{ > > + struct rq *rq; > > + unsigned long flags; > > + int ret; > > + bool success = false; > > + > > + if (t->klp_universe == klp_universe_goal) > > + return true; > > + > > + rq = task_rq_lock(t, &flags); > > + > > + if (task_running(rq, t) && t != current) { > > + pr_debug("%s: pid %d (%s) is running\n", __func__, t->pid, > > + t->comm); > > + goto done; > > + } > > Let me confirm that this always skips running tasks, and klp retries > checking by using delayed worker, correct? Correct. Also, patch 9 of the series adds other ways to convert tasks, using syscalls, irqs and signals. -- 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/