From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH 1/11] Add generic helpers for arch IPI function calls Date: Tue, 22 Apr 2008 16:51:06 +0200 Message-ID: <20080422145105.GJ12774@kernel.dk> References: <1208851058-8500-1-git-send-email-jens.axboe@oracle.com> <1208851058-8500-2-git-send-email-jens.axboe@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: To: Linus Torvalds Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, npiggin-l3A5Bk7waGM@public.gmane.org On Tue, Apr 22 2008, Linus Torvalds wrote: > > > On Tue, 22 Apr 2008, Jens Axboe wrote: > > + > > +static inline void csd_flag_wait(struct call_single_data *data) > > +{ > > + /* Wait for response */ > > + do { > > + /* > > + * We need to see the flags store in the IPI handler > > + */ > > + smp_mb(); > > + if (!(data->flags & CSD_FLAG_WAIT)) > > + break; > > + cpu_relax(); > > + } while (1); > > +} > > You forgot to free the "data" here? The waiter must also free the object, > since now the callee does not. The ipi interrupt handler does that, see kfree() in generic_smp_call_function_single_interrupt() or call_func_data_free() in generic_smp_call_function_interrupt(). -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from brick.kernel.dk ([87.55.233.238]:25437 "EHLO kernel.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755587AbYDVOvM (ORCPT ); Tue, 22 Apr 2008 10:51:12 -0400 Date: Tue, 22 Apr 2008 16:51:06 +0200 From: Jens Axboe Subject: Re: [PATCH 1/11] Add generic helpers for arch IPI function calls Message-ID: <20080422145105.GJ12774@kernel.dk> References: <1208851058-8500-1-git-send-email-jens.axboe@oracle.com> <1208851058-8500-2-git-send-email-jens.axboe@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Linus Torvalds Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, npiggin@suse.de Message-ID: <20080422145106.k48I5NiEWPLMjbKL6g98CcCnmqHm49_wYSpWNXM3kDo@z> On Tue, Apr 22 2008, Linus Torvalds wrote: > > > On Tue, 22 Apr 2008, Jens Axboe wrote: > > + > > +static inline void csd_flag_wait(struct call_single_data *data) > > +{ > > + /* Wait for response */ > > + do { > > + /* > > + * We need to see the flags store in the IPI handler > > + */ > > + smp_mb(); > > + if (!(data->flags & CSD_FLAG_WAIT)) > > + break; > > + cpu_relax(); > > + } while (1); > > +} > > You forgot to free the "data" here? The waiter must also free the object, > since now the callee does not. The ipi interrupt handler does that, see kfree() in generic_smp_call_function_single_interrupt() or call_func_data_free() in generic_smp_call_function_interrupt(). -- Jens Axboe