From: Kent Overstreet Subject: [PATCH 19/25] aio: Give shared kioctx fields their own cachelines Date: Tue, 27 Nov 2012 19:19:46 -0800 Message-ID: <1354072792-20779-20-git-send-email-koverstreet@google.com> References: <1354072792-20779-1-git-send-email-koverstreet@google.com> Cc: zab@redhat.com, bcrl@kvack.org, jmoyer@redhat.com, axboe@kernel.dk, viro@zeniv.linux.org.uk, Kent Overstreet To: linux-aio@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from mail-da0-f46.google.com ([209.85.210.46]:64911 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753006Ab2K1DVH (ORCPT ); Tue, 27 Nov 2012 22:21:07 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so4543419dak.19 for ; Tue, 27 Nov 2012 19:21:06 -0800 (PST) In-Reply-To: <1354072792-20779-1-git-send-email-koverstreet@google.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Kent Overstreet --- fs/aio.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 1ff4d3b..7dee3aa 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -67,13 +67,6 @@ struct kioctx { unsigned long user_id; struct hlist_node list; - wait_queue_head_t wait; - - spinlock_t ctx_lock; - - atomic_t reqs_active; - struct list_head active_reqs; /* used for cancellation */ - unsigned nr; /* sys_io_setup currently limits this to an unsigned int */ @@ -86,6 +79,15 @@ struct kioctx { long nr_pages; struct { + atomic_t reqs_active; + } ____cacheline_aligned; + + struct { + spinlock_t ctx_lock; + struct list_head active_reqs; /* used for cancellation */ + } ____cacheline_aligned; + + struct { struct mutex ring_lock; } ____cacheline_aligned; @@ -94,6 +96,10 @@ struct kioctx { spinlock_t completion_lock; } ____cacheline_aligned; + struct { + wait_queue_head_t wait; + } ____cacheline_aligned; + struct page *internal_pages[AIO_RING_PAGES]; }; -- 1.7.12