From: Vyacheslav Cherkashin Date: Thu, 1 Dec 2016 10:49:22 +0000 (+0300) Subject: Fix BUG() with spm_processor_id() X-Git-Tag: accepted/tizen/3.0/common/20161208.153832~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4ffd8968848d2cd35266d95fd9b0b6cb5779888;p=platform%2Fkernel%2Fswap-modules.git Fix BUG() with spm_processor_id() Use raw_smp_processor_id() instead. If CONFIG_DEBUG_PREEMPT is enabled, spm_processor_id() is defined as debug_smp_processor_id() which should be called only in atomic context. Change-Id: I039f2c0b50bb319a5473a2823db68984bedfe2fe Signed-off-by: Vyacheslav Cherkashin --- diff --git a/ks_features/ksf_msg.c b/ks_features/ksf_msg.c index b465359..d18352d 100644 --- a/ks_features/ksf_msg.c +++ b/ks_features/ksf_msg.c @@ -67,7 +67,7 @@ static void pack_header(struct msg_sys_header *h, unsigned long func_addr, h->probe_type = (u32)type; h->pc_addr = func_addr; h->caller_pc_addr = ret_addr; - h->cpu_num = smp_processor_id(); + h->cpu_num = raw_smp_processor_id(); } static void pack_entry_header(struct msg_sys_entry *e, struct pt_regs *regs, @@ -358,7 +358,7 @@ static void context_switch(struct pt_regs *regs, enum swap_msg_id id) mcs->pc_addr = 0; mcs->pid = task->tgid; mcs->tid = task->pid; - mcs->cpu_num = smp_processor_id(); + mcs->cpu_num = raw_smp_processor_id(); swap_msg_flush_wakeupoff(m, sizeof(*mcs)); swap_msg_put(m); diff --git a/parser/features.c b/parser/features.c index 392f5f5..b17e22e 100644 --- a/parser/features.c +++ b/parser/features.c @@ -307,7 +307,7 @@ static void sample_msg(struct pt_regs *regs) s->pid = task->tgid; s->pc_addr = instruction_pointer(regs); s->tid = task->pid; - s->cpu_num = smp_processor_id(); + s->cpu_num = raw_smp_processor_id(); swap_msg_flush(m, sizeof(*s)); swap_msg_put(m); diff --git a/retprobe/rp_msg.c b/retprobe/rp_msg.c index fbbd3b0..3fb4426 100644 --- a/retprobe/rp_msg.c +++ b/retprobe/rp_msg.c @@ -68,7 +68,7 @@ void rp_msg_entry(struct pt_regs *regs, unsigned long func_addr, ent->tid = task->pid; ent->pc_addr = func_addr; ent->caller_pc_addr = get_regs_ret_func(regs); - ent->cpu_num = smp_processor_id(); + ent->cpu_num = raw_smp_processor_id(); ent->cnt_args = strlen(fmt); size = swap_msg_size(m); @@ -104,7 +104,7 @@ void rp_msg_exit(struct pt_regs *regs, unsigned long func_addr, ext->tid = task->pid; ext->pc_addr = func_addr; ext->caller_pc_addr = ret_addr; - ext->cpu_num = smp_processor_id(); + ext->cpu_num = raw_smp_processor_id(); size = swap_msg_size(m); ret = swap_msg_pack_ret_val(p + sizeof(*ext), size - sizeof(*ext),