diff options
| author | Kent Overstreet <koverstreet@google.com> | 2013-05-07 19:18:56 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-07 21:38:29 -0400 |
| commit | 4e23bcaeb9e8df234e47840ac2c757ab79a0b572 (patch) | |
| tree | fe50c5f26c61804dc0a807a0c9a7dc54ffea4e30 | |
| parent | 58c85dc20a2c5ba0e53740c5dd1945e658da0e1c (diff) | |
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>
| -rw-r--r-- | fs/aio.c | 27 |
1 files changed, 15 insertions, 12 deletions
| @@ -67,13 +67,6 @@ struct kioctx { | |||
| 67 | unsigned long user_id; | 67 | unsigned long user_id; |
| 68 | struct hlist_node list; | 68 | struct hlist_node list; |
| 69 | 69 | ||
| 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 | |||
| 77 | /* | 70 | /* |
| 78 | * This is what userspace passed to io_setup(), it's not used for | 71 | * This is what userspace passed to io_setup(), it's not used for |
| 79 | * anything but counting against the global max_reqs quota. | 72 | * anything but counting against the global max_reqs quota. |
| @@ -92,19 +85,29 @@ struct kioctx { | |||
| 92 | struct page **ring_pages; | 85 | struct page **ring_pages; |
| 93 | long nr_pages; | 86 | long nr_pages; |
| 94 | 87 | ||
| 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 | |||
| 95 | struct { | 100 | struct { |
| 96 | struct mutex ring_lock; | 101 | struct mutex ring_lock; |
| 97 | } ____cacheline_aligned; | 102 | wait_queue_head_t wait; |
| 103 | } ____cacheline_aligned_in_smp; | ||
| 98 | 104 | ||
| 99 | struct { | 105 | struct { |
| 100 | unsigned tail; | 106 | unsigned tail; |
| 101 | spinlock_t completion_lock; | 107 | spinlock_t completion_lock; |
| 102 | } ____cacheline_aligned; | 108 | } ____cacheline_aligned_in_smp; |
| 103 | 109 | ||
| 104 | struct page *internal_pages[AIO_RING_PAGES]; | 110 | struct page *internal_pages[AIO_RING_PAGES]; |
| 105 | |||
| 106 | struct rcu_head rcu_head; | ||
| 107 | struct work_struct rcu_work; | ||
| 108 | }; | 111 | }; |
| 109 | 112 | ||
| 110 | /*------ sysctl variables----*/ | 113 | /*------ sysctl variables----*/ |
