Skip to content

Commit 4e23bca

Browse files
Kent Overstreettorvalds
authored andcommitted
aio: give shared kioctx fields their own cachelines
[akpm@linux-foundation.org: make reqs_active __cacheline_aligned_in_smp] Signed-off-by: Kent Overstreet <koverstreet@google.com> Cc: Zach Brown <zab@redhat.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Jens Axboe <axboe@kernel.dk> Cc: Asai Thambi S P <asamymuthupa@micron.com> Cc: Selvan Mani <smani@micron.com> Cc: Sam Bradshaw <sbradshaw@micron.com> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Benjamin LaHaise <bcrl@kvack.org> Reviewed-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 58c85dc commit 4e23bca

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

‎fs/aio.c‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ struct kioctx {
6767
unsigned long user_id;
6868
struct hlist_node list;
6969

70-
wait_queue_head_t wait;
71-
72-
spinlock_t ctx_lock;
73-
74-
atomic_t reqs_active;
75-
struct list_head active_reqs; /* used for cancellation */
76-
7770
/*
7871
* This is what userspace passed to io_setup(), it's not used for
7972
* anything but counting against the global max_reqs quota.
@@ -92,19 +85,29 @@ struct kioctx {
9285
struct page **ring_pages;
9386
long nr_pages;
9487

88+
struct rcu_head rcu_head;
89+
struct work_struct rcu_work;
90+
91+
struct {
92+
atomic_t reqs_active;
93+
} ____cacheline_aligned_in_smp;
94+
95+
struct {
96+
spinlock_t ctx_lock;
97+
struct list_head active_reqs; /* used for cancellation */
98+
} ____cacheline_aligned_in_smp;
99+
95100
struct {
96101
struct mutex ring_lock;
97-
} ____cacheline_aligned;
102+
wait_queue_head_t wait;
103+
} ____cacheline_aligned_in_smp;
98104

99105
struct {
100106
unsigned tail;
101107
spinlock_t completion_lock;
102-
} ____cacheline_aligned;
108+
} ____cacheline_aligned_in_smp;
103109

104110
struct page *internal_pages[AIO_RING_PAGES];
105-
106-
struct rcu_head rcu_head;
107-
struct work_struct rcu_work;
108111
};
109112

110113
/*------ sysctl variables----*/

0 commit comments

Comments
 (0)