Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757013AbcCaJkT (ORCPT ); Thu, 31 Mar 2016 05:40:19 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36129 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756240AbcCaJkN (ORCPT ); Thu, 31 Mar 2016 05:40:13 -0400 Subject: Re: [RFC PATCH v1.9 13/14] livepatch: add /proc//patch_status To: Josh Poimboeuf , Jiri Kosina , Jessica Yu , Miroslav Benes References: <9de6283945f99958dfd7fac0f24fcce98d5410a6.1458933243.git.jpoimboe@redhat.com> <56FCEEFA.3030309@suse.cz> Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Vojtech Pavlik From: Jiri Slaby Message-ID: <56FCF079.8070708@suse.cz> Date: Thu, 31 Mar 2016 11:40:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56FCEEFA.3030309@suse.cz> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1593 Lines: 50 On 03/31/2016, 11:33 AM, Jiri Slaby wrote: > On 03/25/2016, 08:35 PM, Josh Poimboeuf wrote: >> Expose the per-task klp_universe value so users can determine which >> tasks are holding up completion of a patching operation. >> >> Call it "patch_status" rather than "universe": it's at least more >> descriptive for the average user. >> >> Signed-off-by: Josh Poimboeuf >> --- >> fs/proc/base.c | 12 ++++++++++++ >> 1 file changed, 12 insertions(+) >> >> diff --git a/fs/proc/base.c b/fs/proc/base.c >> index b1755b2..f90998b 100644 >> --- a/fs/proc/base.c >> +++ b/fs/proc/base.c >> @@ -2801,6 +2801,15 @@ static int proc_pid_personality(struct seq_file *m, struct pid_namespace *ns, >> return err; >> } >> >> +#ifdef CONFIG_LIVEPATCH >> +static int proc_pid_patch_status(struct seq_file *m, struct pid_namespace *ns, >> + struct pid *pid, struct task_struct *task) >> +{ >> + seq_printf(m, "%d\n", task->klp_universe); >> + return 0; >> +} >> +#endif /* CONFIG_LIVEPATCH */ >> + >> /* >> * Thread groups >> */ >> @@ -2900,6 +2909,9 @@ static const struct pid_entry tgid_base_stuff[] = { >> REG("timers", S_IRUGO, proc_timers_operations), >> #endif >> REG("timerslack_ns", S_IRUGO|S_IWUGO, proc_pid_set_timerslack_ns_operations), >> +#ifdef CONFIG_LIVEPATCH >> + ONE("patch_status", S_IRUSR, proc_pid_patch_status), >> +#endif > > I think we want to know the state about all tasks, not only group > leaders. This should go to tid_base_stuff. Or loop over all tasks here by for_each_thread(task, t) and check them all. > thanks, -- js suse labs