[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161024134012.GA20798@redhat.com>
Date: Mon, 24 Oct 2016 15:40:13 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: "Ni, BaoleX" <baolex.ni@...el.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"acme@...nel.org" <acme@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"alexander.shishkin@...ux.intel.com"
<alexander.shishkin@...ux.intel.com>,
"Liu, Chuansheng" <chuansheng.liu@...el.com>
Subject: Re: hit a KASan bug related to Perf during stress test
On 10/24, Oleg Nesterov wrote:
>
> -static u32 perf_event_pid(struct perf_event *event, struct task_struct *p)
> +static u32 perf_event_xxx(struct perf_event *event, struct task_struct *p,
> + enum pid_type type)
> {
> + pid_t nr;
> /*
> * only top level events have the pid namespace they were created in
> */
> if (event->parent)
> event = event->parent;
>
> - return task_tgid_nr_ns(p, event->ns);
> + nr = __task_pid_nr_ns(p, type, event->ns);
> + if (!nr && !is_idle_task(p))
> + nr = -1;
> + return nr;
And just in case... In any case __task_pid_nr_ns() and other similar helpers
can also return zero if "p" runs in another namespace. Say, in the parent ns.
Say, perf_event_switch_output(). What do we want to report in this case, zero
or -1 ?
Oleg.
Powered by blists - more mailing lists