From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751826AbbCTS4R (ORCPT ); Fri, 20 Mar 2015 14:56:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46489 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751630AbbCTS4M (ORCPT ); Fri, 20 Mar 2015 14:56:12 -0400 From: Jeff Moyer To: Jens Axboe 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> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Fri, 20 Mar 2015 14:56:04 -0400 In-Reply-To: <550B42EE.8030405@kernel.dk> (Jens Axboe's message of "Thu, 19 Mar 2015 15:43:10 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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