Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754144AbbHCPFg (ORCPT ); Mon, 3 Aug 2015 11:05:36 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36521 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752403AbbHCPFe (ORCPT ); Mon, 3 Aug 2015 11:05:34 -0400 Date: Mon, 3 Aug 2015 23:05:23 +0800 From: Minfei Huang To: Steven Rostedt Cc: yalin wang , tj@kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, mhuang@redhat.com Subject: Re: [PATCH] workqueue: Add the allocation flags to function schedule_on_each_cpu_gfp Message-ID: <20150803150523.GA3116@t440s.lenovo> References: <1438590425-30307-1-git-send-email-mnfhuang@gmail.com> <4F413CE0-A857-4350-AE04-176AA8ADC44E@gmail.com> <20150803100449.52f4dadb@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150803100449.52f4dadb@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1285 Lines: 38 On 08/03/15 at 10:04am, Steven Rostedt wrote: > On Mon, 3 Aug 2015 17:15:53 +0800 > yalin wang 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/