linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/huge_memory.c: reduce critical section protected by split_queue_lock
@ 2020-01-10  2:55 Wei Yang
  2020-01-10 23:50 ` Kirill A. Shutemov
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yang @ 2020-01-10  2:55 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, kirill.shutemov, Wei Yang

split_queue_lock protects data in struct deferred_split. We can release
the lock after delete the page from deferred_split_queue.

This patch moves the THP accounting out of the lock protection, which is
introduced in commit 65c453778aea ("mm, rmap: account shmem thp pages").

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 3c745d298a27..88c541bf44c7 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2810,6 +2810,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
 			ds_queue->split_queue_len--;
 			list_del(page_deferred_list(head));
 		}
+		spin_unlock(&ds_queue->split_queue_lock);
 		if (mapping) {
 			if (PageSwapBacked(head))
 				__dec_node_page_state(head, NR_SHMEM_THPS);
@@ -2817,7 +2818,6 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
 				__dec_node_page_state(head, NR_FILE_THPS);
 		}
 
-		spin_unlock(&ds_queue->split_queue_lock);
 		__split_huge_page(page, list, end, flags);
 		if (PageSwapCache(head)) {
 			swp_entry_t entry = { .val = page_private(head) };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/huge_memory.c: reduce critical section protected by split_queue_lock
  2020-01-10  2:55 [PATCH] mm/huge_memory.c: reduce critical section protected by split_queue_lock Wei Yang
@ 2020-01-10 23:50 ` Kirill A. Shutemov
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill A. Shutemov @ 2020-01-10 23:50 UTC (permalink / raw)
  To: Wei Yang; +Cc: akpm, linux-mm, linux-kernel, kirill.shutemov

On Fri, Jan 10, 2020 at 10:55:16AM +0800, Wei Yang wrote:
> split_queue_lock protects data in struct deferred_split. We can release
> the lock after delete the page from deferred_split_queue.
> 
> This patch moves the THP accounting out of the lock protection, which is
> introduced in commit 65c453778aea ("mm, rmap: account shmem thp pages").
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-10 23:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10  2:55 [PATCH] mm/huge_memory.c: reduce critical section protected by split_queue_lock Wei Yang
2020-01-10 23:50 ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).