From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751378AbbCTTVz (ORCPT ); Fri, 20 Mar 2015 15:21:55 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:34633 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750990AbbCTTVw (ORCPT ); Fri, 20 Mar 2015 15:21:52 -0400 Message-ID: <550C7347.9080206@kernel.dk> Date: Fri, 20 Mar 2015 13:21:43 -0600 From: Jens Axboe User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jeff Moyer CC: Tejun Heo , kent.overstreet@gmail.com, Benjamin LaHaise , linux-kernel@vger.kernel.org Subject: Re: serial percpu_ref draining in exit_aio() References: <20150319173413.GU25365@htj.duckdns.org> <550B30D5.9080207@kernel.dk> <20150319210051.GE19657@htj.duckdns.org> <550B3F58.90109@kernel.dk> <550B42EE.8030405@kernel.dk> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/20/2015 12:56 PM, Jeff Moyer wrote: > Jens Axboe writes: > >> On 03/19/2015 03:27 PM, Jens Axboe wrote: >>> On 03/19/2015 03:00 PM, Tejun Heo wrote: >>>> On Thu, Mar 19, 2015 at 04:58:33PM -0400, Jeff Moyer wrote: >>>>> Do you really want to do memory allocation in the exit path? That >>>>> sounds like a bad idea to me. (Of course, now you're going to point out >>>>> all the places that currently happens, right? ;-) >>>> >>>> I think we just need a counter there - let everyone count down as they >>>> exit and the last one trigger the completion, no? >>> >>> Yeah that's a good point, that'd be cleaner too. I'll change it and test >>> that. >> >> Here's a cleaner variant that pairs the completion even with an atomic >> count. Works for me as well. > > I like this version. I ran it though the libaio test harness and > xfstests aio tests and it passed. > > Thanks, Jens! > > Reviewed-by: Jeff Moyer Thanks for testing, Jeff! I'll send out a proper patch with your reviewed-by as well. -- Jens Axboe