From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756809AbbFRSDO (ORCPT ); Thu, 18 Jun 2015 14:03:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756734AbbFRSCt (ORCPT ); Thu, 18 Jun 2015 14:02:49 -0400 From: Jeff Moyer To: Oleg Nesterov Cc: Al Viro , Andrew Morton , Benjamin LaHaise , linux-aio@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] aio: make aio_ring->dead boolean References: <20150618175209.GA10060@redhat.com> 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: Thu, 18 Jun 2015 14:02:47 -0400 In-Reply-To: <20150618175209.GA10060@redhat.com> (Oleg Nesterov's message of "Thu, 18 Jun 2015 19:52:09 +0200") 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 Oleg Nesterov writes: > "atomic_t dead" makes no sense. atomic_read() is the plain LOAD, > it doesn't have some "additional" synchronization with xchg(). > > And now that kill_ioctx() sets "dead" under mm->ioctx_lock we do > not even need xchg(). > > Signed-off-by: Oleg Nesterov > Reviewed-by: Jeff Moyer > @@ -765,7 +765,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) > err_cleanup: > aio_nr_sub(ctx->max_reqs); > err_ctx: > - atomic_set(&ctx->dead, 1); > + ctx->dead = true; /* unneeded */ I was hoping you'd remove this line entirely. -Jeff