Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1198919

Re: [PATCH] workqueue: Add the allocation flags to function schedule_on_each_cpu_gfp

From Minfei Huang <mnfhuang@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] workqueue: Add the allocation flags to function schedule_on_each_cpu_gfp
Date 2015-08-03 17:10 +0200
Message-ID <pTpxf-6Ex-1@gated-at.bofh.it> (permalink)
References <pTji9-5Zo-1@gated-at.bofh.it> <pTk4y-79G-19@gated-at.bofh.it> <pToBb-5iK-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/03/15 at 10:04am, Steven Rostedt wrote:
> On Mon, 3 Aug 2015 17:15:53 +0800
> yalin wang <yalin.wang2010@gmail.com> wrote:
> 
> > better to also provide a wrapper function with name schedule_on_each_cpu(), 
> > as this function is used frequently .
> > 
> > #define schedule_on_each_cpu(f)  schedule_on_each_cpu_gfp(f, GFP_KERNEL) 
> 
> I was about to say pretty much the same thing. But please make it an
> inline function:
> 
> static inline int schedule_on_each_cpu(work_func_t func)
> {
> 	return schedule_on_each_cpu_gfp(func, GFP_KERNEL);
> }
> 
> Otherwise, NACK to the patch to the ftrace code.

Hi, Steve.

The main reason I posted this patch is to fix the data race bug, when
ftrace tries to free the ops->trampoline in arch x86.

Function schedule_on_each_cpu may fail to alloc percpu work to
synchronise each online cpu. In such situation, trying to free the
trampoline may casue the kernel crash, because one cpu may be executing
the trampoline at this moment.

So I add a new wrapper function to fix it. 

Thanks
Minfei
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] workqueue: Add the allocation flags to function schedule_on_each_cpu_gfp Minfei Huang <mnfhuang@gmail.com> - 2015-08-03 10:30 +0200
  Re: [PATCH] workqueue: Add the allocation flags to function schedule_on_each_cpu_gfp yalin wang <yalin.wang2010@gmail.com> - 2015-08-03 11:20 +0200
    Re: [PATCH] workqueue: Add the allocation flags to function  schedule_on_each_cpu_gfp Steven Rostedt <rostedt@goodmis.org> - 2015-08-03 16:10 +0200
      Re: [PATCH] workqueue: Add the allocation flags to function  schedule_on_each_cpu_gfp Minfei Huang <mnfhuang@gmail.com> - 2015-08-03 17:10 +0200
  Re: [PATCH] workqueue: Add the allocation flags to function  schedule_on_each_cpu_gfp Tejun Heo <tj@kernel.org> - 2015-08-03 16:20 +0200

csiph-web