From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757690AbcIWHVa (ORCPT ); Fri, 23 Sep 2016 03:21:30 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47826 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752747AbcIWHV3 (ORCPT ); Fri, 23 Sep 2016 03:21:29 -0400 Date: Fri, 23 Sep 2016 09:21:17 +0200 From: Peter Zijlstra To: Nicolai Stange Cc: Juergen Gross , Ingo Molnar , Thomas Gleixner , Davidlohr Bueso , Richard Weinberger , linux-kernel@vger.kernel.org Subject: Re: [PATCH] smp: smp_call_on_cpu(): use INIT_WORK_ONSTACK() for automatic work_struct Message-ID: <20160923072117.GK2794@worktop> References: <20160922181758.3449-1-nicstange@gmail.com> <20160922184415.GB5012@twins.programming.kicks-ass.net> <87mviz7nkn.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mviz7nkn.fsf@gmail.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 22, 2016 at 09:15:52PM +0200, Nicolai Stange wrote: > One minor question regarding your patch though: it hasn't got a > destroy_work_on_stack(). Isn't one needed because of > INIT_WORK_ONSTACK() -> __INIT_WORK() -> __init_work() -> > debug_object_init_on_stack() ? > At least work_on_cpu() destroys its local work_struct that way... I wasn't aware of destroy_work_on_stack(), and I'm not familiar enough with the debug objects stuff to see hwo important it is to call. Also, there's more INIT_WORK_ONSTACK usage lacking destroy_work_on_stack() calls. Maybe it would be good to do a patch fixing them all up and adding a comment with INIT_WORK_ONSTACK() that says it ought to be paired with destroy_work_on_stack().