From: Kent Overstreet Date: Tue, 7 May 2013 23:18:56 +0000 (-0700) Subject: aio: give shared kioctx fields their own cachelines X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4e23bcaeb9e8df234e47840ac2c757ab79a0b572;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git aio: give shared kioctx fields their own cachelines [akpm@linux-foundation.org: make reqs_active __cacheline_aligned_in_smp] Signed-off-by: Kent Overstreet Cc: Zach Brown Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Mark Fasheh Cc: Joel Becker Cc: Rusty Russell Cc: Jens Axboe Cc: Asai Thambi S P Cc: Selvan Mani Cc: Sam Bradshaw Cc: Jeff Moyer Cc: Al Viro Cc: Benjamin LaHaise Reviewed-by: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/aio.c b/fs/aio.c index 16239fbd6458..986ff305a856 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 */ - /* * This is what userspace passed to io_setup(), it's not used for * anything but counting against the global max_reqs quota. @@ -92,19 +85,29 @@ struct kioctx { struct page **ring_pages; long nr_pages; + struct rcu_head rcu_head; + struct work_struct rcu_work; + + struct { + atomic_t reqs_active; + } ____cacheline_aligned_in_smp; + + struct { + spinlock_t ctx_lock; + struct list_head active_reqs; /* used for cancellation */ + } ____cacheline_aligned_in_smp; + struct { struct mutex ring_lock; - } ____cacheline_aligned; + wait_queue_head_t wait; + } ____cacheline_aligned_in_smp; struct { unsigned tail; spinlock_t completion_lock; - } ____cacheline_aligned; + } ____cacheline_aligned_in_smp; struct page *internal_pages[AIO_RING_PAGES]; - - struct rcu_head rcu_head; - struct work_struct rcu_work; }; /*------ sysctl variables----*/