Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753434AbeAJWuu (ORCPT + 1 other); Wed, 10 Jan 2018 17:50:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39368 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752119AbeAJWus (ORCPT ); Wed, 10 Jan 2018 17:50:48 -0500 From: Jeff Moyer To: Christoph Hellwig Cc: viro@zeniv.linux.org.uk, Avi Kivity , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 28/32] aio: simplify cancellation References: <20180110155853.32348-1-hch@lst.de> <20180110155853.32348-29-hch@lst.de> 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: Wed, 10 Jan 2018 17:50:43 -0500 In-Reply-To: <20180110155853.32348-29-hch@lst.de> (Christoph Hellwig's message of "Wed, 10 Jan 2018 16:58:49 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 10 Jan 2018 22:50:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Christoph Hellwig writes: > With the current aio code there is no need for the magic KIOCB_CANCELLED > value, as a cancelation just kicks the driver to queue the completion > ASAP, with all actual completion handling done in another thread. Given > that both the completion path and cancelation take the context lock there > is no need for magic cmpxchg loops either. The cmpxchg was made unnecessary when the complementary xchg was removed in commit bec68faaf ("aio: io_cancel() no longer returns the io_event"). There was no longer a need to ensure only the completion path or the cancellation path delivered the completion event. Now, the completion is always delivered via aio_complete. So yeah, we can get rid of this. Acked-by: Jeff Moyer