From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:59646 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727360AbeHGJdg (ORCPT ); Tue, 7 Aug 2018 05:33:36 -0400 Date: Tue, 7 Aug 2018 09:25:55 +0200 From: Christoph Hellwig To: Andrew Morton Cc: Christoph Hellwig , viro@zeniv.linux.org.uk, Avi Kivity , Linus Torvalds , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] aio: allow direct aio poll comletions for keyed wakeups Message-ID: <20180807072555.GA678@lst.de> References: <20180806083058.14724-1-hch@lst.de> <20180806083058.14724-5-hch@lst.de> <20180806152705.37809e16c02543cc24626607@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806152705.37809e16c02543cc24626607@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Aug 06, 2018 at 03:27:05PM -0700, Andrew Morton wrote: > On Mon, 6 Aug 2018 10:30:58 +0200 Christoph Hellwig wrote: > > > If we get a keyed wakeup for a aio poll waitqueue and wake can acquire the > > ctx_lock without spinning we can just complete the iocb straight from the > > wakeup callback to avoid a context switch. > > Why do we try to avoid spinning on the lock? Because we are called with the lock on the waitqueue called, which nests inside it. > > + /* try to complete the iocb inline if we can: */ > > ie, this comment explains 'what" but not "why". > > (There's a typo in Subject:, btw) Because it is faster obviously. I can update the comment.